开发者

How to launch "Google Translate" app?

I would like to launch "Google Translate" applicatio开发者_开发百科n when user taps a button in my app.

is it possible?

Thank you.


I don't know what url scheme supported by the google translate app but you can open the iTranslate app using this -

To launch the application:

NSString *stringURL = @"itranslate://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

To translate a text:

NSString *textToTranslate = @"Hello world"; // Text must be URL-encoded...!
textToTranslate = [textToTranslate stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *test =  [NSString stringWithFormat:@"itranslate://translate?from=en&to=de&text=%@",textToTranslate];
NSURL *url = [[NSURL alloc] initWithString:test];
[[UIApplication sharedApplication] openURL:url];

also have a look on this - http://wiki.akosma.com/IPhone_URL_Schemes


The url scheme for google translate is googletranslate://

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜