P paiac66 Member Licensed User Longtime User Jun 24, 2022 #1 Hi, I have registered my app into Firebase project but nothing push notification arrive to my app. I send message with B4J to topic "general", the result show correctly the message-id. Moreover, how does the subscription of the app to a topic work? Does it result in the firebase project? Thanks in advance
Hi, I have registered my app into Firebase project but nothing push notification arrive to my app. I send message with B4J to topic "general", the result show correctly the message-id. Moreover, how does the subscription of the app to a topic work? Does it result in the firebase project? Thanks in advance
Erel B4X founder Staff member Licensed User Longtime User Jun 26, 2022 #2 All that I can say is that something is misconfigured. Create a new project with the same package name and carefully follow the instructions: https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/ Once you get it working, you should compare it to your full project. Upvote 0
All that I can say is that something is misconfigured. Create a new project with the same package name and carefully follow the instructions: https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/ Once you get it working, you should compare it to your full project.
P paiac66 Member Licensed User Longtime User Jun 28, 2022 #3 I followed your instructions but notifications are not coming. The version of B4A is 11.50, the Manifest file is updated. Also, after calling the channel subscription ("general" in this case), no tokens are returned from Firebase. What am I doing wrong? To send the notifications I use the code of the B4J project "nou ui". I enclose the test project. Thank you Attachments ReceiveFMC.zip ReceiveFMC.zip 11.2 KB · Views: 350 Upvote 0
I followed your instructions but notifications are not coming. The version of B4A is 11.50, the Manifest file is updated. Also, after calling the channel subscription ("general" in this case), no tokens are returned from Firebase. What am I doing wrong? To send the notifications I use the code of the B4J project "nou ui". I enclose the test project. Thank you
Erel B4X founder Staff member Licensed User Longtime User Jun 28, 2022 #4 First step is to set the targetSdkVersion to 30 or 31. Upvote 0
P paiac66 Member Licensed User Longtime User Jun 28, 2022 #5 Erel said: First step is to set the targetSdkVersion to 30 or 31. Click to expand... Oh, I'm sorry, I left the wrong value, before it was correctly at 30 ... Upvote 0
Erel said: First step is to set the targetSdkVersion to 30 or 31. Click to expand... Oh, I'm sorry, I left the wrong value, before it was correctly at 30 ...
Erel B4X founder Staff member Licensed User Longtime User Jun 28, 2022 #6 Start with this example: https://www.b4x.com/android/forum/threads/b4x-b4xpages-firebase-push-example.120523/ If it doesn't work for you then your Firebase project is misconfigured. Upvote 0
Start with this example: https://www.b4x.com/android/forum/threads/b4x-b4xpages-firebase-push-example.120523/ If it doesn't work for you then your Firebase project is misconfigured.
P paiac66 Member Licensed User Longtime User Jun 29, 2022 #7 Hi Erel, the problem seems to be only on my huawei mate 20 lite (which has google services) and Android 10. In fact, I tested it on another device and everything works. Do you have any suggestions? Upvote 0
Hi Erel, the problem seems to be only on my huawei mate 20 lite (which has google services) and Android 10. In fact, I tested it on another device and everything works. Do you have any suggestions?
P paiac66 Member Licensed User Longtime User Jun 29, 2022 #9 aeric said: Click to expand... It doesn't work ... Can you explain to me why the fmc token is not generated? If the token is not generated, the registration to the topic is not carried out and, therefore, notifications do not arrive. Some idea? Upvote 0
aeric said: Click to expand... It doesn't work ... Can you explain to me why the fmc token is not generated? If the token is not generated, the registration to the topic is not carried out and, therefore, notifications do not arrive. Some idea?
P paiac66 Member Licensed User Longtime User Jun 29, 2022 #10 HELP ME! I installed firebase-iid (ver. 17...) from SDKManager and now, when run my app with firebase, it crash! how can i fix it? Upvote 0
HELP ME! I installed firebase-iid (ver. 17...) from SDKManager and now, when run my app with firebase, it crash! how can i fix it?
aeric Expert Licensed User Longtime User Jun 29, 2022 #11 paiac66 said: HELP ME! I installed firebase-iid (ver. 17...) from SDKManager and now, when run my app with firebase, it crash! how can i fix it? Click to expand... You may want to start a new thread. Find the folder and delete any version you think a mistake C:\<AndroidSDK>\extras\b4a_remote\com\google\firebase\firebase-iid Then run update SDK Manager with the right version? (I have version 20.2.4) Upvote 0
paiac66 said: HELP ME! I installed firebase-iid (ver. 17...) from SDKManager and now, when run my app with firebase, it crash! how can i fix it? Click to expand... You may want to start a new thread. Find the folder and delete any version you think a mistake C:\<AndroidSDK>\extras\b4a_remote\com\google\firebase\firebase-iid Then run update SDK Manager with the right version? (I have version 20.2.4)
Erel B4X founder Staff member Licensed User Longtime User Jun 30, 2022 #12 paiac66 said: HELP ME! I installed firebase-iid (ver. 17...) from SDKManager and now, when run my app with firebase, it crash! how can i fix it? Click to expand... Don't. Delete your SDK and download a new one: https://www.b4x.com/b4a.html Upvote 0
paiac66 said: HELP ME! I installed firebase-iid (ver. 17...) from SDKManager and now, when run my app with firebase, it crash! how can i fix it? Click to expand... Don't. Delete your SDK and download a new one: https://www.b4x.com/b4a.html
P paiac66 Member Licensed User Longtime User Jun 30, 2022 #13 Erel said: Don't. Delete your SDK and download a new one: https://www.b4x.com/b4a.html Click to expand... Thanks for you suggestion, I did it. But i still have the issue of the token not being generated on my huawei mate 20 lite. I'm frustrated!? Upvote 0
Erel said: Don't. Delete your SDK and download a new one: https://www.b4x.com/b4a.html Click to expand... Thanks for you suggestion, I did it. But i still have the issue of the token not being generated on my huawei mate 20 lite. I'm frustrated!?
aeric Expert Licensed User Longtime User Jun 30, 2022 #14 paiac66 said: Thanks for you suggestion, I did it. But i still have the issue of the token not being generated on my huawei mate 20 lite. I'm frustrated!? Click to expand... I thought I don't need to worry about the token if I am using topic to send. The token is for sending to single device. Correct me if I am wrong. Upvote 0
paiac66 said: Thanks for you suggestion, I did it. But i still have the issue of the token not being generated on my huawei mate 20 lite. I'm frustrated!? Click to expand... I thought I don't need to worry about the token if I am using topic to send. The token is for sending to single device. Correct me if I am wrong.
DonManfred Expert Licensed User Longtime User Jun 30, 2022 #15 aeric said: The token is for sending to single device. Correct me if I am wrong. Click to expand... No, that´s correct. You have to send this token to your backend to be able to send to this token from serverside. Upvote 0
aeric said: The token is for sending to single device. Correct me if I am wrong. Click to expand... No, that´s correct. You have to send this token to your backend to be able to send to this token from serverside.
aeric Expert Licensed User Longtime User Jun 30, 2022 #16 DonManfred said: No, that´s correct. You have to send this token to your backend to be able to send to this token from serverside. Click to expand... Thanks @DonManfred I have been long time no develop with B4A especially with Firebase. I am not sure I remember correctly. I remember I tried with token but it made things more complicated as the token keep refreshed and renewed with a new one. I don't know the correct way to handle it. Using a topic subscription is easier to manage. I just need to store the unique topics of the registered devices like "and_prod_100001" and "ios_dev_100002" in my database server. To send to individual devices, I can use "and" prefix for Android, "ios" for iOS and "prod" denotes Production/Live and "dev" denotes Development version. Upvote 0
DonManfred said: No, that´s correct. You have to send this token to your backend to be able to send to this token from serverside. Click to expand... Thanks @DonManfred I have been long time no develop with B4A especially with Firebase. I am not sure I remember correctly. I remember I tried with token but it made things more complicated as the token keep refreshed and renewed with a new one. I don't know the correct way to handle it. Using a topic subscription is easier to manage. I just need to store the unique topics of the registered devices like "and_prod_100001" and "ios_dev_100002" in my database server. To send to individual devices, I can use "and" prefix for Android, "ios" for iOS and "prod" denotes Production/Live and "dev" denotes Development version.
P paiac66 Member Licensed User Longtime User Jun 30, 2022 #17 Thanks @aeric, a good idea is that of the progressive number for each device. But the messages don't arrive anyway. On my device, in the app's notification settings, "allow notifications" is enabled but as the "notification type" it appears "This app has not sent notifications yet". On another devices (Android 9) everything works perfectly. Upvote 0
Thanks @aeric, a good idea is that of the progressive number for each device. But the messages don't arrive anyway. On my device, in the app's notification settings, "allow notifications" is enabled but as the "notification type" it appears "This app has not sent notifications yet". On another devices (Android 9) everything works perfectly.
aeric Expert Licensed User Longtime User Jun 30, 2022 #18 I don't know what's wrong. I suggest you check back the tutorial video again. https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/ Upvote 0
I don't know what's wrong. I suggest you check back the tutorial video again. https://www.b4x.com/android/forum/t...-messages-firebase-cloud-messaging-fcm.67716/
aeric Expert Licensed User Longtime User Jun 30, 2022 #19 I check your project in post #3. You have this line. I don't think it is needed. B4X: #AdditionalJar: com.google.android.gms:play-services-base You also have different code in Starter service. Yours: B4X: Sub Service_Create End Sub Sub Service_Start (StartingIntent As Intent) CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases. End Sub Erel's B4XPages example: B4X: Sub Service_Create CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") End Sub Sub Service_Start (StartingIntent As Intent) Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases. End Sub Just start from the Push.zip project mentioned by Erel in post #6 above. Upvote 0
I check your project in post #3. You have this line. I don't think it is needed. B4X: #AdditionalJar: com.google.android.gms:play-services-base You also have different code in Starter service. Yours: B4X: Sub Service_Create End Sub Sub Service_Start (StartingIntent As Intent) CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases. End Sub Erel's B4XPages example: B4X: Sub Service_Create CallSubDelayed(FirebaseMessaging, "SubscribeToTopics") End Sub Sub Service_Start (StartingIntent As Intent) Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases. End Sub Just start from the Push.zip project mentioned by Erel in post #6 above.
P paiac66 Member Licensed User Longtime User Jun 30, 2022 #20 I fixed the code but it still doesn't work Upvote 0