Closed mobileappsr closed 3 years ago
Hi @hansemannn ,
Waiting for your response. We are stuck and unable to proceed. Any help is appreciated @hansemannn
Sorry, I am not able to provide open source support right now.
Thanks @hansemannn
@mobileappsr did you manage to solve this issue?
Please use this combination (note the exact versions):
<!-- Ti.PlayServices -->
<module platform="android" version="16.1.3">ti.playservices</module>
<!-- Firebase Core -->
<module platform="android" version="5.0.0">firebase.core</module>
<!-- Firebase Cloud Messaging -->
<module platform="android" version="2.0.2">firebase.cloudmessaging</module>
<!-- Firebase Analytics -->
<module platform="android" version="3.0.0">firebase.analytics</module>
@hansemannn you mention firebase cloudmessaging 2.0.2, but there's only a version 2.0.1 as far as I know. I tried the 2.0.1 version, but that didn't work out
@ErikDohmen
Cloud Messaging 2.0.2 showed up in the releases yesterday. I just tried it and everything worked except that the module could not get the firebase instance id. I did some research and found that when I placed these lines in my tiapp.xml file everything started to work with the latest modules.
<service android:name="com.google.firebase.components.ComponentDiscoveryService" >
<meta-data android:name="com.google.firebase.components:com.google.firebase.iid.Registrar" android:value="com.google.firebase.components.ComponentRegistrar" />
</service>
@jwogan5 Hi Jason, How do you initialize the core/cloudmessaging and analytics? Can you show me? Or drop me an email?
Within alloy.js I have the following lines. The android google-services.json is stored in app/assets/android/ I also have the google_app_id string located at platform/android/res/values/strings.xml
The modules in tiapp.xml are all pointing to the newest versions.
const FirebaseCore = require('firebase.core');
// This line is in a different file form me but I just require the module here. require('firebase.cloudmessaging');
// This line is in a different file form me but I just require the module here. require('firebase.analytics');
try {
if (Ti.Platform.name == 'android') {
FirebaseCore.configure({
file: '/google-services.json'
});
} else {
FirebaseCore.configure({
file: 'GoogleService-Info.plist'
});
}
} catch (e) {}
And you include the firebase cloudmessage and analytics before or after the configuration?
You include it before the config and after the firebase core require. In the example above the 2 lines commented are we I include them, I just have the requires in other files that I included before the config call.
I was using 16.1.5 of the ti.playservices which had an extra issue with the androidx classification. Went back to the 16.1.4 version, but that gave me other errors. Finally removed the play-services-ads-lite.aar from this version and it started to work again. Took a while, but I'm there now. Thanks for all the help @jwogan5
Hi @hansemannn we just downloaded and integrated FireBase Analytics and Core latest modules 3.0.0 and 5.0.0 respectively and seeing the issue Failed resolution of: Lcom/google/android/gms/measurement/internal/zzbw
[ERROR] : TiExceptionHandler: Ti.App.FirebaseAnalytics.log('click' [ERROR] : TiExceptionHandler: ^ [ERROR] : TiExceptionHandler: Error: Failed resolution of: Lcom/google/android/gms/measurement/internal/zzbw; [ERROR] : TiExceptionHandler: at Label. (/app.js:36:28)
[ERROR] : TiExceptionHandler: com.google.firebase.analytics.FirebaseAnalytics.getInstance(Unknown Source) [ERROR] : TiExceptionHandler: firebase.analytics.TitaniumFirebaseAnalyticsModule.analyticsInstance(TitaniumFirebaseAnalyticsModule.java:37) [ERROR] : TiExceptionHandler: firebase.analytics.TitaniumFirebaseAnalyticsModule.log(TitaniumFirebaseAnalyticsModule.java:46) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:978) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1207) [ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:265) [ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:98)
We haven't included any other third party module in the sample app. Can you please suggest what exactly is going wrong. We are using Ti 7.5.2GA SDK and play services 16.x.
Sample app previously used to work with FireBase Analytics and Core 2.1.0 and 3.0.0 respectively.
Any help is appreciated @hansemannn
Thanks in advance.