Cordova-plugin-firebase: Cordova 7 ๊ฒฝ๋กœ๊ฐ€ ๋ณ€๊ฒฝ๋˜์—ˆ์œผ๋ฉฐ after_prepare ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์—…๋ฐ์ดํŠธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2017๋…„ 12์›” 05์ผ  ยท  5์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: arnesson/cordova-plugin-firebase

์ฐธ์กฐ: https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

Cordova 7 ์„ค์น˜์˜ ๊ฒฝ์šฐ 51ํ–‰์—์„œ after_prepare.js๋ฅผ stringsXml: ANDROID_DIR + '/app/src/main/res/values/strings.xml' ๋กœ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

after_prepare ํ›„ํฌ๊ฐ€ ์‚ญ์ œ๋œ ์ด ํ”Œ๋Ÿฌ๊ทธ์ธ์˜ ํฌํฌ๋ฅผ ์ž‘์—… ์ค‘์ž…๋‹ˆ๋‹ค. ์•„์ง ๋ฌธ์„œ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  • ์ฝ”๋ฅด๋„๋ฐ” 7.1.0 ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
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"

google-services.json / GoogleService-Info.plist ๋ฅผ ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ์— ๋ฐฐ์น˜ํ–ˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.

์„ค์ •.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>

ํ”Œ๋Ÿฌ๊ทธ์ธ์€ ์ด์ œ ํ”Œ๋Ÿฌ๊ทธ์ธ src ๋‚ด์—์„œ ์˜ค๋ž˜๋œ ๋ฒ„์ „์˜ iOS Firebase ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์šด๋ฐ˜ํ•˜๋Š” ๋Œ€์‹  CocoaPods๋ฅผ ํ†ตํ•ด iOS ์ข…์†์„ฑ์„ ์„ค์น˜ํ•˜๋ฏ€๋กœ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์น˜ํ•˜๊ธฐ ์ „์— ์‹œ์Šคํ…œ์— Cocoapods๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค. phonegap-plugin-push ์—๋Š” ์ด์™€ ๊ด€๋ จํ•˜์—ฌ ์ข‹์€ ํŠœํ† ๋ฆฌ์–ผ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฏธ Cocoapods ์„ค์ •์ด์žˆ๋Š” ๊ฒฝ์šฐ, ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์น˜ํ•˜๊ธฐ ์ „์—์ด ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค :

$ pod repo update

์ด์ œ App.xcodeproj ๋Œ€์‹  XCode์—์„œ App.xcworkspace ํŒŒ์ผ์„ ์—ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ด€์‹ฌ์ด ์žˆ๋‹ค๋ฉด ๋‚ด ํฌํฌ๋ฅผ ์ฃผ์‹œํ•˜์‹ญ์‹œ์˜ค. ์•ž์œผ๋กœ ๋”.

๋ชจ๋“  5 ๋Œ“๊ธ€

์•ˆ๋…•ํ•˜์„ธ์š” @michaelreiser์— ๋Œ€ํ•œ ํ’€ ๋ฆฌํ€˜์ŠคํŠธ ๋ฅผ ์—ด์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ ๋™์•ˆ ๋‹น์‹ ์€ ์‹œ๋„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

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

์ž‘๋™ ๋ฐฉ์‹์„ ์•Œ๋ ค์ฃผ์„ธ์š”.

๊ฐ์‚ฌ ํ•ด์š”. ์ตœ์‹  ์ •๋ณด๋ฅผ ์•Œ๋ ค ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.

after_prepare ํ›„ํฌ๊ฐ€ ์‚ญ์ œ๋œ ์ด ํ”Œ๋Ÿฌ๊ทธ์ธ์˜ ํฌํฌ๋ฅผ ์ž‘์—… ์ค‘์ž…๋‹ˆ๋‹ค. ์•„์ง ๋ฌธ์„œ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  • ์ฝ”๋ฅด๋„๋ฐ” 7.1.0 ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
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"

google-services.json / GoogleService-Info.plist ๋ฅผ ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ์— ๋ฐฐ์น˜ํ–ˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.

์„ค์ •.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>

ํ”Œ๋Ÿฌ๊ทธ์ธ์€ ์ด์ œ ํ”Œ๋Ÿฌ๊ทธ์ธ src ๋‚ด์—์„œ ์˜ค๋ž˜๋œ ๋ฒ„์ „์˜ iOS Firebase ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์šด๋ฐ˜ํ•˜๋Š” ๋Œ€์‹  CocoaPods๋ฅผ ํ†ตํ•ด iOS ์ข…์†์„ฑ์„ ์„ค์น˜ํ•˜๋ฏ€๋กœ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์น˜ํ•˜๊ธฐ ์ „์— ์‹œ์Šคํ…œ์— Cocoapods๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค. phonegap-plugin-push ์—๋Š” ์ด์™€ ๊ด€๋ จํ•˜์—ฌ ์ข‹์€ ํŠœํ† ๋ฆฌ์–ผ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฏธ Cocoapods ์„ค์ •์ด์žˆ๋Š” ๊ฒฝ์šฐ, ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์„ค์น˜ํ•˜๊ธฐ ์ „์—์ด ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค :

$ pod repo update

์ด์ œ App.xcodeproj ๋Œ€์‹  XCode์—์„œ App.xcworkspace ํŒŒ์ผ์„ ์—ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ด€์‹ฌ์ด ์žˆ๋‹ค๋ฉด ๋‚ด ํฌํฌ๋ฅผ ์ฃผ์‹œํ•˜์‹ญ์‹œ์˜ค. ์•ž์œผ๋กœ ๋”.

@christocracy ๋‹น์‹ ์ด ํฌ๋“œ๋ฅผ ๋ถ„๋ฅ˜ํ•˜๋ฉด ๊ธฐ๊บผ์ด PR์„

๋‚˜๋Š” 12์›”๋ถ€ํ„ฐ ์‡ ์•ฝํ•ด์ง„ ์ž‘์—… ํฌํฌ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค. ๋ฌธ์ œ๋Š” ์ œ๊ฐ€ ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์‹ค์ œ๋กœ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ €๋Š” ํ’€ํƒ€์ž„ ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ฐœ๋ฐœ์ž์ด๊ณ  ์‚ฌ์šฉ์ž๋“ค์€ ์ด ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์ž์ฃผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๋‚˜๋Š” ๋‹น์‹ ์—๊ฒŒ PR์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋ผ๊ฑด๋Œ€ ๋‹น์‹ ์ด ์ข‹์€ ํ…Œ์ŠคํŠธ๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰