在iOS 9中,我遇到了使用canOpenURL专门打开Google应用程序的问题 .
在Google Sign-In crashes on iOS 9的帮助下,我更改了我的 Info.plist 并添加了 LSApplicationQueriesSchemes ,如下所示
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fb</string>
<string>youtube</string>
<string>twitter</string>
<string>com-google-gidconsent-google</string>
<string>com-google-gidconsent-youtube</string>
<string>com-google-gidconsent</string>
<string>com.google.gppconsent.2.4.1</string>
<string>com.google.gppconsent.2.4.0</string>
<string>googlechrome</string>
<string>googlechrome-x-callback</string>
<string>hasgplus4</string>
<string>com.google.gppconsent.2.3.0</string>
<string>com.google.gppconsent.2.2.0</string>
<string>com.google.gppconsent</string>
<string>gplus</string>
</array>
所有其他应用程序,如Facebook yotube twitter工作正常,但谷歌加上不会打开,并显示以下错误
-canOpenURL:URL失败:“gplus://” - 错误:“(null)”
这是谷歌应用程序的一些问题吗?
NSString *strURL = @"gplus://";
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:strURL]])
{
}
else
{
strURL = @"https://www.plus.google.com";
}