【发布时间】:2016-07-05 15:16:26
【问题描述】:
我正在尝试实现 Google 回调 URL 方案,一切正常,除了“源应用程序”按钮将从 Google 地图应用程序调用我的应用程序。
NSMutableString *googleMapURL = [NSMutableString stringWithString:@"comgooglemaps-x-callback://"];
[googleMapURL appendFormat:@"?saddr=%@",sourceAddress];
[googleMapURL appendFormat:@"&daddr=%@",destinationAddress];
[googleMapURL appendFormat:@"&x-success=myridepicker://?resume=true&x-source=AirApp"];
NSLog(@"Google Map URL %@",googleMapURL);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapURL]];
来自日志的完整 URL:comgooglemaps-x-callback://?saddr=C+Block%2C+Noida%2C+Uttar+Pradesh&daddr=Sector+4%2C+New+Delhi%2C+Delhi%2C+India&x-success=myridepicker://?resume=true&x-source=AirApp
【问题讨论】:
-
你的 URI 在我看来不错。你的听众可能有问题。请注意,在 ios9 中,Apple 默认提供了反向链接。
-
无法弄清楚这有什么问题。希望有人能指出来。
-
嘿 rohit,你有解决办法吗
-
不,没有。现在,每当您的应用打开应用时,它都是 iOS 10 中的默认行为。
标签: ios objective-c google-maps