Android Xamarin push notifications not working

I followed the instructions in the Xamarin Android setup and have:

airshipconfig.properties

google-services.json

airship dll

call takeoff in oncreate

  public override void OnCreate()
        {
            base.OnCreate();
         

            // Call takeOff
            UAirship.TakeOff(this, (UAirship airship) =>
            {
                airship.PushManager.UserNotificationsEnabled = true;
                airship.PushManager.Tags = new String[] { "android-xamarin" };
            });
            try
            {
                var channelid = UAirship.Shared().PushManager.ChannelId;
              
            }
            catch (Exception)
            {

            }

 

Under the audience tab in the dashboard I see some channels but they're all inactive.  I see no tokens

Didn't find what you were looking for?

New post

Comments

35 comments

  • Patrick,

    Okay, after searching around some, I found that this could be due to how Xamarin Studio deploys the APK to your device. Theoretically you should be able to have Xamarin/Visual Studio create the APK for you and manually install like you would with a regular Android app, and that might "fix" it. So, don't deploy the app from Xamarin or Visual Studio and see if that consistently allows you to be able to receive push.

    This is backed up by folks in StackOverflow and other Xamarin forums where users run into this.

    Would you be able to test in that scenario and see if that produces different results?

    Comment actions Permalink
    0
  • That was it!  You're a genius and a scholar!  Thank you!

    Comment actions Permalink
    0
  • Patrick,

    Good to hear!

    I'll chat have a chat with our Engineering team and some folks at Xamarin to see if we can mitigate that in the future.

    Comment actions Permalink
    0
  • Yeah, its interesting that I'm pretty sure for the other app that worked the whole time, I deployed it at least once using the apk through hockey app.  Subsequently I debugged locally from VS, and the push worked still.  Maybe you need to just deploy the app at least once with an apk.

    Comment actions Permalink
    0
  • Patrick,

    Sounds like that could be the case.

    Either way, it's kinda gross to have to do that :)

    Comment actions Permalink
    0

Please sign in to leave a comment.