SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

how to add google-services.json to cordova root?

In my quest to implement a third party push notification system, I'm trying to implement Google's Firebase plugin and system. I'm able to incorporate the Firebase Cordova plugin into my project, but their instructions say to load their google-services.json file at the cordova root in order to implement the plugin on the Android side.

I pursued a path of exporting the Android Studio Project and adding the file at the Cordova root. But I'm finding the Appery Android Studio Project export doesn't work entirely. My goal was to build the APK from Android Studio, but I've run into a myriad of issues (my current error message is "Gradle sync failed: Could not find method registerResGeneratingTask() for arguments [task ':processDebugGoogleServices'...".

Is there an easy way to load the google-services.json file at the cordova root from the Appery UI and build the APK with the Appery interface? What process would you recommend to accomplish this?

I'm a newbie with Android Studio and would prefer a method that didn't require me to build the APK with it.

Any assistance would be appreciated.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

how to add google-services.json to cordova root?

Hi Steve,

Just a quick question... Can you foot back to the reason why you’re not using the Appery notifications system and related API?

Our experience has been that these integrate well with Google and your android phone... And users receive the notifications on their android device as well as Apple users receive the notifications on their iOS device.

I’m sure there’s a great reason so can you help us understand what that is ?

Happy Friday,
Bruce
Image

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

how to add google-services.json to cordova root?

I am currently using the Appery push notification system. Although I am out of app slots on my subscription. If I backup and remove an app from the Appery system, in order to build another app, the app I removed loses it's ability to receive push notifications.

So I want to implement a third party push system so that I can remove the app from the Appery platform and retain the ability to send and receive push notifications. Make sense?

If you have another suggestion, I'm all ears.

Thanks,

Steve

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

how to add google-services.json to cordova root?

Steve,

They Appery database serves as a convenient home for device IDs and the tokens that are supplied by both platforms... Apple and android... It serves as a place/repository where device IDs are related to tokens which are necessary in order to call the APIs supplied by both Apple and Google.

In a pinch, and I haven’t done this but I do know the capability exists, at start up... You can relate device ID to token from the push plug-in that is supplied with Appery.

I have some code that does this already.

The next step after creating your own database of device IDs and tokens, would then be to understand the required API calls to the native backend in order to send push notifications... Without an Appery backend... Not rocket science by any means but definitely not a drop in the bucket.

Other than that you’re right I don’t have any great ideas but I don’t see that plug in you’re working with as a real productive long-term answer.

Best,
Bruce

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

how to add google-services.json to cordova root?

I already have the external database of device IDs and tokens. We use a REST call to the Appery API to send out push notifications currently. But if we remove the app from Appery, the app's device database and push info go away and there's no way to use the Appery backend to send the push notification (to my knowledge).

That's why we're pursuing a third party way to send the push notifications. We've tried Batch.com's system but the Appery build failed with their Cordova plugin enabled. So we looked into OneSignal.com's system, but when their Cordova plugin is called, the app seems to hang. So our third approach is to use the Firebase plugin. We can initialize this plugin on the Apple side through the use of the Apple Xcode system, but we're struggling with getting the Appery Android Studio export to work with the current version of Android Studio (version 3.0.0).

If you have any ideas or suggestions, please share!

Thanks,

Steve

Return to “Issues”