IOS swift使用Google Plus登录

时间:2016-09-22 11:21:45

标签: ios swift gmail ios9 google-plus

在iOS 9 SDK上测试google-plus-ios-sdk-1.7.1时,调用GPPSignIn.sharedInstance()会导致对canOpenURL的内部Google Sign-In SDK调用崩溃

  2016-09-22 14:12:56.135 MCN[305:49025] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.1://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.4.1"
2016-09-22 14:12:56.137 MCN[305:49025] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.4.0"
2016-09-22 14:12:56.139 MCN[305:49025] -canOpenURL: failed for URL: "com.google.gppconsent.2.3.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.3.0"
2016-09-22 14:12:56.140 MCN[305:49025] -canOpenURL: failed for URL: "com.google.gppconsent.2.2.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.2.0"
2016-09-22 14:12:56.141 MCN[305:49025] -canOpenURL: failed for URL: "com.google.gppconsent://" - error: "This app is not allowed to query for scheme com.google.gppconsent"
2016-09-22 14:12:56.143 MCN[305:49025] -canOpenURL: failed for URL: "hasgplus4://" - error: "This app is not allowed to query for scheme hasgplus4"

添加此方案

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>com.example.foo</string>
    <string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</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>
</array>

得到其他崩溃

2016-09-22 14:20:01.169 MCN[309:50443] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.1://" - error: "(null)"
2016-09-22 14:20:01.171 MCN[309:50443] -canOpenURL: failed for URL: "com.google.gppconsent.2.4.0://" - error: "(null)"
2016-09-22 14:20:01.173 MCN[309:50443] -canOpenURL: failed for URL: "com.google.gppconsent.2.3.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.3.0"
2016-09-22 14:20:01.175 MCN[309:50443] -canOpenURL: failed for URL: "com.google.gppconsent.2.2.0://" - error: "This app is not allowed to query for scheme com.google.gppconsent.2.2.0"
2016-09-22 14:20:01.177 MCN[309:50443] -canOpenURL: failed for URL: "com.google.gppconsent://" - error: "This app is not allowed to query for scheme com.google.gppconsent"

1 个答案:

答案 0 :(得分:0)

我认为下面的内容可能适合你。

<key>LSApplicationQueriesSchemes</key>
    <array>
        <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>
    </array>