Background notifications working on some devices but not on others

Hi there,

 

I've spent the last few hours trying to get background notifications to work on one of my two test devices, to no avail. Here's the current setup.

I have an iPhone SE and an iPhone 7 Plus. Both have the same version of iOS, 11.2.2, the latest one. They're both running the exact same version of the app. They have both given the same permissions for both notifications and background app refresh.

This is an example of what I'm sending:

{
"audience": {
"named_user": "4"
},
"notification": {
"ios" : {
"content-available": true,
"priority": 5
}
},
"device_types": ["ios"]
}

The situation with the iPhone SE is as follows:

receivedForegroundNotification delegate function is triggered when a foreground push is sent.

receivedBackgroundNotification delegate function is triggered when a background push is sent.

 

The situation with the iPhone 7 Plus is as follows:

Neither of the Urban Airship delegate functions are triggered.

HOWEVER: When I send a simple "Hello" alert it comes through just fine with the app in the background, though it never triggers any code.

 

So clearly the device is registered. As far as Urban Airship is telling me from the dashboard, both of the named users' devices (they're different named users) have given all green consent.

 

I don't know what else could be wrong. I can post some of my code if you guys want but given that it works fine on one device and not on another, I can't imagine that's the issue. Any help would really be much appreciated.

Didn't find what you were looking for?

New post

Comments

2 comments

  • Hello,

    This is Sean with Urban Airship Technical Support.

    Are you able to replicate this behavior, where each device interacts with the delegate functions differently, using our iOS Sample App?

    Please let me know if you have any other questions or concerns.

    Thank you,
    Sean Conlin
    Urban Airship Technical Support
    Portland, Oregon

    Comment actions Permalink
    0
  • Hi Sean,

    Thanks for the suggestion. I was actually not able to replicate the behavior, which is good! Because I like your product and want to keep using it.

    I then re-tested with my code, and the issue was gone too! Which was strange... the only thing I had changed in between is that I had some code that was asking for permission to push notifications both through Urban Airship and directly through UNUserNotification. I got rid of the latter part, and since then the issue is gone. Still weird that this would only cause problems on some devices and not on others, but I'm glad it's fixed!

    Thanks for your help.

    Comment actions Permalink
    0

Please sign in to leave a comment.