[英]Issue with OneSignal and Xamarin iOS
我在我的Xamarin iOS應用程序中使用OneSignal服務,符合以下文檔: https ://documentation.onesignal.com/docs/xamarin-sdk-setup
我已經完成了所有步驟,但是如果我覆蓋了AppDelegate方法
OnResignActivation
DidEnterBackground
WillEnterForeground
WillTerminate
OnActivated
我收到了下一個錯誤:
ObjCRuntime.RuntimeException: Cannot get the method descriptor for the selector 'oneSignalApplicationDidBecomeActive:' on the type 'AppDelegate', because the selector does not correspond to a method
我需要覆蓋那些方法,我的錯誤是什么?
謝謝!
在你的應用程序的AppDelegate中試試這個
[Export ("oneSignalApplicationDidBecomeActive:")]
public void OneSignalApplicationDidBecomeActive(UIApplication application) {
Console.WriteLine ("oneSignalApplicationDidBecomeActive:");
}
我遇到了與oneSignalDidFailRegisterForRemoteNotification類似的問題:錯誤:
修復了AppDelegate中的這段代碼。 希望能幫助到你
[Export("oneSignalDidFailRegisterForRemoteNotification:error:")]
public void OneSignalDidFailRegisterForRemoteNotification(UIApplication app, NSError error)
{
Console.WriteLine("oneSignalDidFailRegisterForRemoteNotification:error:");
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.