Cordova-plugin-firebase: Cordova 7 path has changed and after_prepare script should be updated

Created on 5 Dec 2017  ·  5Comments  ·  Source: arnesson/cordova-plugin-firebase

See: https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

For Cordova 7 installations, after_prepare.js should be set to stringsXml: ANDROID_DIR + '/app/src/main/res/values/strings.xml' on line 51

Most helpful comment

I'm working on a fork of this plugin where the after_prepare hook is deleted. I still need to add docs.

  • Cordova 7.1.0 is required.
cordova plugin add https://github.com/transistorsoft/cordova-plugin-firebase#cordova-7.1.0 --variable APP_ID="YOUR_APP_ID" --variable API_KEY="YOUR_KEY"

Assuming you've placed your google-services.json / GoogleService-Info.plist in the root of your project:

config.xml

  <platform name="android">
    <resource-file src="google-services.json" target="app/google-services.json" />
  </platform>

  <platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
  </platform>

The plugin will now install its iOS dependencies via CocoaPods instead of carrying around out-of-date versions of iOS Firebase libs within the plugin src so before you install the plugin, make sure you've got Cocoapods set up on your system. phonegap-plugin-push has a good tutorial in this regard.

If you do have Cocoapods setup already, make sure you do this before installing the plugin:

$ pod repo update

You'll now need to open the App.xcworkspace file in XCode instead of the App.xcodeproj

Keep an eye on my fork if you're interested. More to come.

All 5 comments

Hey @michaelreiser I opened a pull request for it. In the meantime you could try

cordova plugin add https://github.com/amritk/cordova-plugin-firebase

and let me know how it works.

Thanks. I'll keep you updated

I'm working on a fork of this plugin where the after_prepare hook is deleted. I still need to add docs.

  • Cordova 7.1.0 is required.
cordova plugin add https://github.com/transistorsoft/cordova-plugin-firebase#cordova-7.1.0 --variable APP_ID="YOUR_APP_ID" --variable API_KEY="YOUR_KEY"

Assuming you've placed your google-services.json / GoogleService-Info.plist in the root of your project:

config.xml

  <platform name="android">
    <resource-file src="google-services.json" target="app/google-services.json" />
  </platform>

  <platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
  </platform>

The plugin will now install its iOS dependencies via CocoaPods instead of carrying around out-of-date versions of iOS Firebase libs within the plugin src so before you install the plugin, make sure you've got Cocoapods set up on your system. phonegap-plugin-push has a good tutorial in this regard.

If you do have Cocoapods setup already, make sure you do this before installing the plugin:

$ pod repo update

You'll now need to open the App.xcworkspace file in XCode instead of the App.xcodeproj

Keep an eye on my fork if you're interested. More to come.

@christocracy I'll happily take a PR if you get the pods sorted out. Android 7 issue should now be sorted in master at 039e29e

I have a working fork languishing since December. Problem is, I don’t actually use the plugin I’m a full time plugin dev and my users often use this one.

I can send a PR to you, hopefully you can give it a good test.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ulisesvera picture ulisesvera  ·  5Comments

LKruglov picture LKruglov  ·  4Comments

JonSmart picture JonSmart  ·  3Comments

stephan-nordnes-eriksen picture stephan-nordnes-eriksen  ·  5Comments

jdla1990 picture jdla1990  ·  4Comments