iOS Question Firebase messages are being sent but not received

cooperlegend

Active Member
Licensed User
Longtime User
So code hasn't changed much recently but my firebase messages are not being received on the iOS version of my App, Android version is fine (sending and receiving)
What have I got wrong?
Help much appreciated
 

cooperlegend

Active Member
Licensed User
Longtime User
Thanks Erel

I tried to follow the video tutorial but I got lost in it a bit as the Apple Store options are now out of date (Apple has two options now for push services, which one do I use ?)

I am happy to re-create everything again from scratch, but so far I have failed to get this working.

Log files are not helping, they don't report back anything.

Wasted two hours this morning trying every option I could think off, nothing works (Thanks Apple for making this impossibly complicated)
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
Yes, I can see the logs, but they don't indicate any issues.
I need to just re-create every thing again , Certificates, Profiles, App IDs, firebase stuff, but the tutorial is out of date, I don't know what options to pick
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
upload_2019-10-7_8-16-42.png
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
See iOS push and Apple Push options, which one? I don't plan on becoming an Apple expert, I just want to get past this hurdle :)
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
This is what I see in the logs

Application_Start
Application_Active
FCMConnected
Application_Pushtoken
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
I have no idea how to resolve this...

I have re-built all my certs/profiles, uploaded and renewed firebase and download the .info, project runs with no errors but still doesn't received messages

aps.cer do I use this one (renamed to ios_sapphire) or do I use the distribution one previously set up (I tried both in my project btw and neither worked)

Help :)
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
just put the aps.cer in the keys file and create the firebase push file later, uplaod the firebase file to firebase console and build your app with your own distrbution profile not aps.cer
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
OK, I started everything from scratch...

I took the existing App ID Identifier (I wasn't able to delete and re-create this as it is used already in the Store)

I then created a new apple push service certificate (aps.cer) and a new Production certificate (IOS Distribution)

Created a new provision certificate for the push service

Created the firebase_push.p12 key

Uploaded to firebase console and downloaded GoogleService-Info.plist and copied this to Special

Checked my App code matches the example

Fired a message off using the B4J code

Android App shows the message

iOS App never triggers the sub Application_RemoteNotification

Log in the App shows

B4X:
Application_Active
FCMConnected
Application_Inactive
Application_Pushtoken
Application_Active
FCMConnected

Why is this not working?????
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
I don't understand???

I am simply trying to get the iOS version of my App to respond the the firebase messages that I am sending , this was working fine in previous releases but it stopped working, I have renewed all the App certs and profiles and the google firebase certificates, but it still doesn't work. It will send messages fine but doesn't receive them :)
Android version of the same App sends and receives message fine.

What do you mean by "The code in the tutorial doesn't match the logs:" ???
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
I have tried on my iPod Touch and both iPads that I have.

Seems very odd that it can send a message yet not receive one, would it not be able to send messages if something in the certificates were wrong?

Logs show no errors, code in my App matches the sample code as far as necessary (and was working in previous releases, nothing around this part of the code has changed)
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
So after much hair pulling and zero helpful suggestions from here I finally sussed out what has changed.

For some reason subscribing to a topic "update" no longer works on iOS (but still works fine on Android) I now need to update my code to put in topic "ios_update" (even though I don't want it to only work on Apple)

When did this change?

Is this a firebase library change in B4X ?

topic "update" was work just fine last year.....
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
So after much hair pulling and zero helpful suggestions from here I finally sussed out what has changed.

For some reason subscribing to a topic "update" no longer works on iOS (but still works fine on Android) I now need to update my code to put in topic "ios_update" (even though I don't want it to only work on Apple)

When did this change?

Is this a firebase library change in B4X ?

topic "update" was work just fine last year.....

How are you sending the messages to ios users ? with b4j app or firebase console ? If you are using b4j code, there is a warning about that code saying : "Use the attached B4J (non-ui) program to send messages. It handles ios messages a bit differently. There is an assumption that all iOS topics start with ios_."

so if your topic is not starting with ios_ it is normal you are not receving them but I don't know how you were getting them last year. Using the firebase messaging for years never had an issue but all my topics are starting with ios_
 
Upvote 0

cooperlegend

Active Member
Licensed User
Longtime User
Obviously something changed (either in the libraries or in google firebase) Because I have been using firebase for about 3 years now and only recently notice that the iOS version was no longer receiving the messages. The ios_general comment as you have quoted is by no mean definitive (with the word "assumption") so it was only when going back to basics and trying every single possible option that I finally sussed it. So I assume if I change to "ios_update" etc it will still work on Android.
It does nark me that I have to put ios_ infront of everything, why? firebase is a Google tool !!!!!
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Obviously something changed (either in the libraries or in google firebase) Because I have been using firebase for about 3 years now and only recently notice that the iOS version was no longer receiving the messages. The ios_general comment as you have quoted is by no mean definitive (with the word "assumption") so it was only when going back to basics and trying every single possible option that I finally sussed it. So I assume if I change to "ios_update" etc it will still work on Android.
It does nark me that I have to put ios_ infront of everything, why? firebase is a Google tool !!!!!

b4j code is not a google tool, there are different requirements to send notification to ios devices and different requirements for sending to android devices. If you check the b4j code you will see :

B4X:
    If Topic.StartsWith("ios_") Then
        Dim iosalert As Map =  CreateMap("title": Title, "body": Body, "sound": "default")
        m.Put("notification", iosalert)
        m.Put("priority", 10)
    End If

the code only adjusts the message to send to ios devices when it sees the topic name starts with ios_ so if you dont have ios_ it will adjust the map for android devices. So as long as you are using this code, you have to put ios_ before topics or change the code for this tool.

Maybe something changed on firebase side, and if stg changed, Erel should also have updated to b4j code but if you do not do what is written on the tutorial, that's on you.
 
Upvote 0
Top