Problems with content-available on iOS

719 views
Skip to first unread message

Fernando Takai

unread,
Apr 14, 2021, 12:29:30 PM4/14/21
to Firebase Google Group

Hey there!

We are using FCM to do some content updates on our iOS app. We have pushes that use content-available: 1 and some that don't.

(sorry for the code formatting)

The ones that *don't use it* are working fine, but the ones that use it are returning with:

{'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT',
'details': [{'@type': 'type.googleapis.com/google.firebase.fcm.v1.FcmError', 'errorCode': 'INVALID_ARGUMENT'},
{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'message.token', 'description': 'Invalid registration token'}]}]}}

Now, by testing stuff around i was able to track this down to exactly "content-available" with iOS tokens. Android works perfectly:

In [145]: test = {'data': {'test': '1'}, 'token': android_token, 'apns': {'payload': {'aps': {'content-available': 1}}}}
In [146]: await sender.send_data_to_firebase({'message': test})

now with ios:

In [147]: test = {'data': {'test': '1'}, 'token': ios_token, 'apns': {'payload': {'aps': {'content-available': 1}}}}

In [148]: await sender.send_data_to_firebase({'message': test})

{'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.firebase.fcm.v1.FcmError', 'errorCode': 'INVALID_ARGUMENT'}, {'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'message.token', 'description': 'Invalid registration token'}]}]}}

and if i remove the apns/aps option from the ios call, it works as expected.

Has anyone seen this?

Baladet Sakh

unread,
Apr 14, 2021, 12:33:50 PM4/14/21
to fireba...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/19177c55-9df0-4efd-9ff5-7dd1522cc8ben%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages