2017-04-14 88 views
1

我想添加Facebook應用程序,邀請這樣的:Facebook應用不邀請工作

let content:FBSDKAppInviteContent = FBSDKAppInviteContent() 
     content.appLinkURL = URL(string: "https://fb.me/...") 
     content.appInvitePreviewImageURL = URL(string: "http://...") 

     let dialog = FBSDKAppInviteDialog() 
     dialog.content = content 
     dialog.delegate = self 
     dialog.fromViewController = self 
     dialog.show() 

相關的Info.plist鍵:

<key>FacebookAppID</key> 
<string>...</string> 
<key>FacebookDisplayName</key> 
<string>Blanket</string> 
<key>LSApplicationQueriesSchemes</key> 
<array> 
    <string>fbapi</string> 
    <string>fbapi20130214</string> 
    <string>fbapi20130410</string> 
    <string>fbapi20130702</string> 
    <string>fbapi20131010</string> 
    <string>fbapi20131219</string> 
    <string>fbapi20140410</string> 
    <string>fbapi20140116</string> 
    <string>fbapi20150313</string> 
    <string>fbapi20150629</string> 
    <string>fbapi20160328</string> 
    <string>fbauth</string> 
    <string>fbauth2</string> 
    <string>fb-messenger-api20140430</string> 
    <string>fb-messenger-platform-20150128</string> 
    <string>fb-messenger-platform-20150218</string> 
    <string>fb-messenger-platform-20150305</string> 
    <string>fbapi</string> 
    <string>fb-messenger-api</string> 
    <string>fbauth2</string> 
    <string>fbshareextension</string> 
</array> 

<key>CFBundleURLTypes</key> 
<array> 
    <dict> 
     <key>CFBundleURLName</key> 
     <string>com.my.app</string> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>fb...</string> 
      <string>myappscheme</string> 
     </array> 
    </dict> 
</array> 

當我運行代碼,打開Safari窗口,並顯示加載微調後關閉。返回

此錯誤:

"Error: Optional(Error Domain=com.facebook.sdk.core Code=2 \"(null)\" UserInfo={com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Invalid method_results., com.facebook.sdk:FBSDKErrorArgumentNameKey=method_results})"

Facebook應用程序被安裝在設備上,並共享對話框中的Facebook應用程序中打開。

當我嘗試調試,在[FBSDKApplicationDelegate _handleBridgeAPIResponseURL:sourceApplication:]響應URL是fb...://bridge/appinvites?version=web&bridge_args=%7B%22app_name%22%3A%22...%22%2C%22action_id%22%3A%...%22%7D&error=%7B%22error%22%3A%22server_error%22%2C%22error_description%22%3A%22Error%20retrieving%20application%20configuration.%22%7D

相關的錯誤:

{"error":"server_error","error_description":"Error retrieving application configuration."} 

我不知道這是什麼錯誤意味着,是Facebook應用程序的配置錯誤,或iOS應用。

Android上的同一邀請作品,iOS應用發佈,並配置了有效的iTunes網址。

+0

http://stackoverflow.com/q/34468728/5461400 –

回答

2

我能邀請基於上述代碼,以便請檢查Facebook應用程序ID,看看它是否正確輸入的朋友。並查看您是否在p列表中提供了正確的url標識符和url方案。

0

你可以嘗試,看看它是否工作在無線網絡連接。它似乎還有在Facebook應用程序邀請不移動數據工作中的錯誤,但使用WiFi時的工作(得到相同的錯誤同上。)

https://developers.facebook.com/bugs/798217780334522/

如果它工作在wifi和不工作在移動數據中,請通過上面的鏈接進行報告以解決問題。

+0

的蟲子在Facebook的團隊被證實試圖立即解決它。從鏈接中可以看出。 –