OneSignal和Xamarin iOS的问题

Oll*_*vel 4 xamarin.ios ios xamarin onesignal

我在我的Xamarin iOS应用程序中使用OneSignal服务,符合以下文档:https://documentation.onesignal.com/docs/xamarin-sdk-setup

我已经完成了所有步骤,但是如果我覆盖了AppDelegate方法

OnResignActivation
DidEnterBackground
WillEnterForeground
WillTerminate
OnActivated
Run Code Online (Sandbox Code Playgroud)

我收到了下一个错误:

ObjCRuntime.RuntimeException: Cannot get the method descriptor for the selector 'oneSignalApplicationDidBecomeActive:' on the type 'AppDelegate', because the selector does not correspond to a method
Run Code Online (Sandbox Code Playgroud)

我需要覆盖那些方法,我的错误是什么?

谢谢!

小智 7

在你的应用程序的AppDelegate中试试这个

[Export ("oneSignalApplicationDidBecomeActive:")]
public void OneSignalApplicationDidBecomeActive(UIApplication application) {
    Console.WriteLine ("oneSignalApplicationDidBecomeActive:");
}
Run Code Online (Sandbox Code Playgroud)