我嘗試實現雲消息傳遞,並面臨一個問題,它使我的遊戲終止。但我沒有例子項目的這個問題。無法識別的選擇器「fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:」in GG雲消息傳遞
相關類的GGLInstanceIDTokenManager,它是libGGLInstanceIDLib.a lib中的私有類。下面是我看到的Xcode日誌:
2015-06-16 18:13:04.446 BreezeGame[2307:427893] -[GGLInstanceIDTokenManager fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]: unrecognized selector sent to instance 0x14681290
2015-06-16 18:13:04.713 BreezeGame[2307:427893] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GGLInstanceIDTokenManager fetchTokenWithAuthorizedEntity:scope:keyPair:options:handler:]: unrecognized selector sent to instance 0x14681290'
爲什麼沒有發現Xcode中fetchTokenWithAuthorizedEntity:範圍:密鑰對:選擇:處理器:功能?
請幫我解決它。我是Cloud Messaging的新手。
你在項目中使用'CocoaPods'一個在GoogleService-Info.plist中?如果沒有,您可以按照[本頁](https://developers.google.com/cloud-messaging/ios/client)中的步驟進行操作。另外請確保您將'GoogleService-Info.plist'添加到您的項目中。 – ztan
是的,我遵循指南中的一步一步。並確定我添加了GoogleService-Info.plist。我也創建了一個新項目,並且它工作。所以我仍然不知道爲什麼沒有Xcode找到這個功能?你知道有些事情會導致問題嗎? –
我認爲你在項目文件設置中缺少了-ObjC鏈接器標誌。由於該方法是在類中定義的,並且如果您沒有設置,鏈接器不會添加這些類別方法,並且它會失敗。 這是關於這個http://stackoverflow.com/questions/2567498/objective-c-categories-in-static-library的更多信息 – evanescent