Y ykucuk Well-Known Member Licensed User Longtime User Aug 2, 2020 #1 B4X: 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 Any help ? B4i v6.80 Firebase v2.50 Attachments Screen Shot 2020-08-02 at 04.08.08.png 60.2 KB · Views: 188
B4X: 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 Any help ? B4i v6.80 Firebase v2.50
Erel B4X founder Staff member Licensed User Longtime User Aug 2, 2020 #2 Please post the error as text. Upvote 0
Semen Matusovskiy Well-Known Member Licensed User Aug 2, 2020 #3 A subroutine works fine under B4i v6.80 + Firebase v2.50. Of course, if other was configurated correctly. Try attached example in Simulator (you need to add own GoogleService-info.plist to Files\Special ) Attachments Q.zip 993 bytes · Views: 177 Upvote 0
A subroutine works fine under B4i v6.80 + Firebase v2.50. Of course, if other was configurated correctly. Try attached example in Simulator (you need to add own GoogleService-info.plist to Files\Special )
Y ykucuk Well-Known Member Licensed User Longtime User Aug 2, 2020 #4 Erel said: Please post the error as text. Click to expand... B4X: Application_Start Error occurred on line: 48 (Main) Object was not initialized (NSObject) Stack Trace: ( CoreFoundation __exceptionPreprocess + 331 libobjc.A.dylib objc_exception_throw + 48 CoreFoundation +[NSException raise:format:] + 197 B4iExample -[B4IObjectWrapper object] + 139 B4iExample -[B4INativeObject RunMethod::] + 116 B4iExample -[b4i_main _gettoken] + 515 B4iExample -[ResumableSub_main_Application_Start resume::] + 828 B4iExample -[b4i_main _application_start:] + 501 CoreFoundation __invoking___ + 140 CoreFoundation -[NSInvocation invoke] + 325 B4iExample +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1669 B4iExample -[B4IShell runMethod:] + 401 B4iExample -[B4IShell raiseEventImpl:method:args::] + 1775 B4iExample -[B4IShellBI raiseEvent:event:params:] + 1357 B4iExample __33-[B4I raiseUIEvent:event:params:]_block_invoke + 51 libdispatch.dylib _dispatch_call_block_and_release + 12 libdispatch.dylib _dispatch_client_callout + 8 libdispatch.dylib _dispatch_main_queue_callback_4CF + 1276 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 CoreFoundation __CFRunLoopRun + 2310 CoreFoundation CFRunLoopRunSpecific + 626 GraphicsServices GSEventRunModal + 65 UIKitCore UIApplicationMain + 140 B4iExample main + 112 libdyld.dylib start + 1 ) Application_Active Upvote 0
Erel said: Please post the error as text. Click to expand... B4X: Application_Start Error occurred on line: 48 (Main) Object was not initialized (NSObject) Stack Trace: ( CoreFoundation __exceptionPreprocess + 331 libobjc.A.dylib objc_exception_throw + 48 CoreFoundation +[NSException raise:format:] + 197 B4iExample -[B4IObjectWrapper object] + 139 B4iExample -[B4INativeObject RunMethod::] + 116 B4iExample -[b4i_main _gettoken] + 515 B4iExample -[ResumableSub_main_Application_Start resume::] + 828 B4iExample -[b4i_main _application_start:] + 501 CoreFoundation __invoking___ + 140 CoreFoundation -[NSInvocation invoke] + 325 B4iExample +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1669 B4iExample -[B4IShell runMethod:] + 401 B4iExample -[B4IShell raiseEventImpl:method:args::] + 1775 B4iExample -[B4IShellBI raiseEvent:event:params:] + 1357 B4iExample __33-[B4I raiseUIEvent:event:params:]_block_invoke + 51 libdispatch.dylib _dispatch_call_block_and_release + 12 libdispatch.dylib _dispatch_client_callout + 8 libdispatch.dylib _dispatch_main_queue_callback_4CF + 1276 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 CoreFoundation __CFRunLoopRun + 2310 CoreFoundation CFRunLoopRunSpecific + 626 GraphicsServices GSEventRunModal + 65 UIKitCore UIApplicationMain + 140 B4iExample main + 112 libdyld.dylib start + 1 ) Application_Active
Y ykucuk Well-Known Member Licensed User Longtime User Aug 2, 2020 #5 Semen Matusovskiy said: A subroutine works fine under B4i v6.80 + Firebase v2.50. Of course, if other was configurated correctly. Try attached example in Simulator (you need to add own GoogleService-info.plist to Files\Special ) Click to expand... It does work with FirebaseAnalytics but doesn't work with Notification Upvote 0
Semen Matusovskiy said: A subroutine works fine under B4i v6.80 + Firebase v2.50. Of course, if other was configurated correctly. Try attached example in Simulator (you need to add own GoogleService-info.plist to Files\Special ) Click to expand... It does work with FirebaseAnalytics but doesn't work with Notification
Semen Matusovskiy Well-Known Member Licensed User Aug 2, 2020 #6 Include FirebaseAnalytics (in addition to FirebaseNotifications) into your project and initialize it before FirebaseMessaging Upvote 0
Include FirebaseAnalytics (in addition to FirebaseNotifications) into your project and initialize it before FirebaseMessaging