OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
105 stars 50 forks source link

onesignal.current is not available. #138

Closed Lipsapatel123 closed 5 years ago

Lipsapatel123 commented 5 years ago

Hi,

I am facing issue in adding this code in my application

followed this manual https://documentation.onesignal.com/docs/xamarin-sdk-setup

my app is just for android xamarin

Trying to add below code. using Com.OneSignal;

protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main);

OneSignal.Current.StartInit("YOUR_ONESIGNAL_APP_ID") .EndInit(); }

but CURRENT is not coming after writing ONESIGNAL.

suggest where will be error if i create CURRENT method manually then i don;t have nay idea what to wrote in it

rgomezp commented 5 years ago

Hello, I'm sorry I didn't quite understand your question. Could you please elaborate on what you're looking for?

T-T-P commented 5 years ago

I too am facing this issue in OneSignalNotificationServiceExtension NotificationService.cs

The lines:

(OneSignal.Current as OneSignalImplementation).DidReceiveNotificationExtensionRequest(request, BestAttemptContent);

and

(OneSignal.Current as OneSignalImplementation).ServiceExtensionTimeWillExpireRequest(ReceivedRequest, BestAttemptContent);

both error with the following message:

The type or namespace name 'Current' does not exist in the namespace 'OneSignal' (are you missing an assembly reference?)

rgomezp commented 5 years ago

Hello @Lipsapatel123 @T-T-P Could you try following my response in #135 and let me know if this does it for you?

rgomezp commented 5 years ago

Closing due to no response