Pushwoosh: how does it work

477 views Asked by At

I would like to know how the pushwoosh system works. The first two times the app is started by the user, the doOnRegistered() handler is executed. After the first two times, this doesn't happen anymore.

Another big problem is that i need to get my tags, but there's no way to know if the manager is registered or not. So the first two times, the handler for the async method inside the method UserController.Instance.GetPushwooshTags (ApplicationContext) is called before the manager is registered (so before doOnRegistered is called). How can i fix this?

i did everything like this: https://www.pushwoosh.com/programming-push-notification/android/android-additional-platforms/xamarin-android/

i'm doing something like this in my activity:

    protected override void OnCreate (Bundle bundle)
    {
        base.OnCreate (bundle);
        SetContentView (Resource.Layout.mainAppActivity);

        mMessageReceiver = new LocalMessageBroadcastReceiver ();
        mMessageReceiver.activity = this;

        mRegisterReceiver = new LocalRegisterBroadcastReceiver ();
        mRegisterReceiver.activity = this;

        ArelloMobile.Push.PushManager manager = ArelloMobile.Push.PushManager.GetInstance (this);
        manager.OnStartup (this);

        //Register for push!
        manager.RegisterForPushNotifications();
        checkMessage (Intent);

        //this method calls pushManager.GetTagsAsync(context,listener);
        UserController.Instance.GetPushwooshTags (ApplicationContext);

    }


    public void doOnRegistered(String registrationId)
    {
        Console.WriteLine ("registered for pushwoosh");
        // code to run if device has succesfully registered

    }
1

There are 1 answers

0
VeYroN On

But does your app receive pushes? Have you tested in http://cp.pushwoosh.com? If not you should also check this docs: gcm configuration and manifiest changes