iOS Question firebase message InvalidRegistration

ihabsharaf

Member
Licensed User
Longtime User
i install instructions more than 3 times and notification not work

from b4j project i received this

{"multicast_id":9149513846036958707,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}


the same project work perfect with b4a
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add this code to your app. What is the output:
B4X:
Sub Application_PushToken (Success As Boolean, Token() As Byte)
   Log($"PushToken: ${Success}"$)
   Dim bc As ByteConverter
   Log(bc.HexFromBytes(Token))
   Log(LastException)
End Sub

Firebase notifications works properly.
Only you can find out which setting is not set correctly. If you are unable to find it then start from scratch (including a new firebase project).
 
Upvote 0

ihabsharaf

Member
Licensed User
Longtime User
now im start from scratch
i have new error
when build bridge

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies
Provisioning profile "Sendebad" has app ID "Sendebad.app", which does not match the bundle ID "Sendebad.app.bridge".
Code signing is required for product type 'Application' in SDK 'iOS 10.1'


Error: ** BUILD FAILED **


The following build commands failed:
Check dependencies
(1 failure)
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Hi, I have the same problem:
when sending general messages works correctly, but when I send individual messages I get this error

B4X:
{"multicast_id":7269211709821177279,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
[SOLVER]

B4X:
Sub Application_PushToken (Success As Boolean, Token() As Byte)
    Log($"PushToken: ${Success}"$)
    Dim bc As ByteConverter
    Log(bc.HexFromBytes(Token))
    Log(LastException)
    Log(GetToken)   < ------ THIS  TOKEN
End Sub

Private Sub GetToken As String
    Dim no As NativeObject
    Dim token As NativeObject = no.Initialize("FIRInstanceID").RunMethod("instanceID", Null).RunMethod("token", Null)
    If token.IsInitialized Then Return token.AsString Else Return ""
End Sub
 
Upvote 0
Top