rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
178 stars 161 forks source link

Bundle object Extras is null all the time #116

Open Cantek opened 7 years ago

Cantek commented 7 years ago

Hello,

I am trying to figure out if app is being created by clicking on push notification via using the Bundle object which is sent to onCreate function as parameter. Depending on the parameters sent via push message I want to open different views of the application. As you can understand I am using this plugin in a Xamarin forms application to receive push notifications. Notifications are being shown properly and when I click them it opens the app properly. But I could not figure out how to reach the same parameters from inside the opened app to decide what to do in next step.

Let's say push notification Title is Football and text is Barcelona, I want to receive that from inside the app and open directly the football category with Barcelona's details. But I can not receive this data at the moment. What ever I tried I couldn't figure it out.

    protected override void OnCreate(Bundle bundle)
    {
        //bundle.Extras param is always NULL
        base.OnCreate(bundle);

        global::Xamarin.Forms.Forms.Init(this, bundle);

But it is coming as NULL all the time. What should I do to fix that?

And also, if this approach is wrong what can I use instead?

Thanks in Advance

rdelrosario commented 7 years ago

Try this prerelease: https://www.nuget.org/packages/Xam.Plugin.PushNotification/1.2.5-beta