Comments (47)
I've tested APNS push notifications via the Firebase Console and they worked fine, so on that basis I think this version is good to release. I'll merge to master and release to npm shortly.
from cordova-plugin-firebasex.
@dpa99c I'm trying to upgrade from cordova-plugin-firebase
to cordova-plugin-firebasex
in another project of mine. Sadly I can't build the iOS project. Looks like the pod installation fails:
~> pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
In snapshot (Podfile.lock):
GoogleUtilities/MethodSwizzler (= 6.2.0, ~> 6.0)
In Podfile:
Firebase/Performance (= 5.20.2) was resolved to 5.20.2, which depends on
FirebasePerformance (= 2.2.4) was resolved to 2.2.4, which depends on
GoogleUtilities/MethodSwizzler (~> 5.2)
Specs satisfying the `GoogleUtilities/MethodSwizzler (= 6.2.0, ~> 6.0), GoogleUtilities/MethodSwizzler (~> 5.2)` dependency were found, but they required a higher minimum deployment target.
I'm using version 3.0.1
of this plugin (and Android works like a charm).
This is the corresponding entry in my config.xml
:
<plugin name="cordova-plugin-firebasex" spec="^3.0.1">
<variable name="ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION" value="17.0.0" />
<variable name="ANDROID_FIREBASE_CORE_VERSION" value="17.0.0" />
<variable name="ANDROID_FIREBASE_MESSAGING_VERSION" value="19.0.0" />
<variable name="ANDROID_FIREBASE_CONFIG_VERSION" value="18.0.0" />
<variable name="ANDROID_FIREBASE_PERF_VERSION" value="18.0.0" />
<variable name="ANDROID_FIREBASE_AUTH_VERSION" value="18.0.0" />
<variable name="ANDROID_CRASHLYTICS_VERSION" value="2.9.8" />
<variable name="ANDROID_SHORTCUTBADGER_VERSION" value="1.1.22" />
<variable name="IOS_FIREBASE_CORE_VERSION" value="5.20.2" />
<variable name="IOS_FIREBASE_AUTH_VERSION" value="5.20.2" />
<variable name="IOS_FIREBASE_MESSAGING_VERSION" value="5.20.2" />
<variable name="IOS_FIREBASE_PERFORMANCE_VERSION" value="5.20.2" />
<variable name="IOS_FIREBASE_REMOTECONFIG_VERSION" value="5.20.2" />
<variable name="IOS_FABRIC_VERSION" value="1.9.0" />
<variable name="IOS_CRASHLYTICS_VERSION" value="3.12.0" />
</plugin>
from cordova-plugin-firebasex.
GoogleUtilities/MethodSwizzler (~> 5.2)` dependency were found, but they required a higher minimum deployment target.
Looks like the target (min) SDK for iOS is set lower than what GoogleUtilities requires.
Mine is set to iOS 10.0 in my test project - check what yours is set to.
from cordova-plugin-firebasex.
Where do I need to check? 🤔
from cordova-plugin-firebasex.
Open the project in Xcode and look under "General" for Target under Deployment Info - here's a screenshot of my test project in Xcode 11 beta:
from cordova-plugin-firebasex.
Mine is already set to 11.0
! 🤔
from cordova-plugin-firebasex.
Give me a few minutes - just need fix a bug in a production build - and I'll push my test project to github so you can try building that.
from cordova-plugin-firebasex.
I believe that your's is building. I'm just wondering why mine isn't. Could that be because of another plugin? What else information could I paste?
Hah! I just had a look at my Podfile
:
platform :ios, '9.0'
use_frameworks!
target 'DummyProject' do
pod 'Google-Mobile-Ads-SDK', '~> 7.36'
pod 'Firebase/Core', '5.20.2'
pod 'Firebase/Auth', '5.20.2'
pod 'Firebase/Messaging', '5.20.2'
pod 'Firebase/Performance', '5.20.2'
pod 'Firebase/RemoteConfig', '5.20.2'
pod 'Fabric', '1.9.0'
pod 'Crashlytics', '3.12.0'
end
Interesting. iOS 9, uh? Just changed it, trying it again...
from cordova-plugin-firebasex.
https://github.com/dpa99c/cordova-plugin-firebase/blob/master/plugin.xml#L105
from cordova-plugin-firebasex.
We should probably either get rid of that or make it configurable in this fork of the firebase plugin
from cordova-plugin-firebasex.
I removed it manually, but it didn't change anything. Now I'm just removing ios platform and re-add it afterwards...
from cordova-plugin-firebasex.
I'm not getting it to work. :-(
from cordova-plugin-firebasex.
Try cloning and building this example project.
I've got it building and running on both Android & iOS though currently not getting a device token on iOS - investigating why that is - might have been my updating of the Firebase SDK for iOS that did it...
from cordova-plugin-firebasex.
I can build that project (at least after changing the package-id), but it won't run because of the missing GoogleService-Info.plist
.
So it should not have anything to do with the platform :ios, '9.0'
definition in the Podfile
, because it's the same definition for your test project and my real project.
from cordova-plugin-firebasex.
I did try to change this line manually in my plugins
(and node_modules/cordova-plugin-firebase/
) folder:
https://github.com/dpa99c/cordova-plugin-firebase/blob/master/plugin.xml#L105
After that I removed the ios platform and re-added it, but nothing changed:
~> pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GoogleUtilities/MethodSwizzler":
In snapshot (Podfile.lock):
GoogleUtilities/MethodSwizzler (= 6.2.0, ~> 6.0)
In Podfile:
Firebase/Performance (= 5.20.2) was resolved to 5.20.2, which depends on
FirebasePerformance (= 2.2.4) was resolved to 2.2.4, which depends on
GoogleUtilities/MethodSwizzler (~> 5.2)
Specs satisfying the `GoogleUtilities/MethodSwizzler (= 6.2.0, ~> 6.0), GoogleUtilities/MethodSwizzler (~> 5.2)` dependency were found, but they required a higher minimum deployment target.
This is my current Podfile
:
platform :ios, '11.0'
use_frameworks!
target 'DummyProject' do
pod 'Google-Mobile-Ads-SDK', '~> 7.44'
pod 'Firebase/Core', '5.20.2'
pod 'Firebase/Auth', '5.20.2'
pod 'Firebase/Messaging', '5.20.2'
pod 'Firebase/Performance', '5.20.2'
pod 'Firebase/RemoteConfig', '5.20.2'
pod 'Fabric', '1.9.0'
pod 'Crashlytics', '3.12.0'
end
Looks like what I did wasn't enough.
from cordova-plugin-firebasex.
Couple of related issues:
From the comments there it's worth trying pod repo update && rm -Rf platforms/ios/ && cordova platform add ios
from cordova-plugin-firebasex.
That fixes it temporary, but a new pod issue occurs now:
~> pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
In Podfile:
Firebase/Performance (= 5.20.2) was resolved to 5.20.2, which depends on
Firebase/Core (= 5.20.2) was resolved to 5.20.2, which depends on
FirebaseAnalytics (= 5.8.1) was resolved to 5.8.1, which depends on
GoogleAppMeasurement (= 5.8.1)
Google-Mobile-Ads-SDK (~> 7.44) was resolved to 7.46.0, which depends on
GoogleAppMeasurement (~> 6.0)
And the old issue re-appears as soon as I drop the platform and re-add it. I need to run pod update
to produce the new issue...
from cordova-plugin-firebasex.
Looks like one of the other plugins in your project is pulling in Google-Mobile-Ads-SDK
which is requiring a newer version of GoogleAppMeasurement
than is supported by Firebase SDK v5.20.2
I think that should get fixed when the the original title of this issue is resolved, i.e. update to Firebase SDK v6 - the newer version will probably request a newer version of GoogleAppMeasurement
from cordova-plugin-firebasex.
Do you have any timetable for the upgrade to Firebase SDK v6? I wouldn't mind donating some bucks for your effort.
from cordova-plugin-firebasex.
I haven't looked at what the breaking changes exactly are with v6.
I think I'll just include the latest v6 into an iOS build, see what breaks and try to fix it 😄
I'll have a go at that over the next few days.
In the meantime, maybe it's possible to track down where Google-Mobile-Ads-SDK
is being pulled into your build and see if you can pin it to an older version that also depends on [email protected]
(i.e. same as Firebase SDK v5.20.2)
from cordova-plugin-firebasex.
I've already tracked that down. The source is the admob-plus
plugin (see https://github.com/admob-plus/admob-plus). And to be honest, I'm not sure how to pin it to an older version. And I'm not sure, if that wouldn't probably break some functionality. I don't like that idea. For me the better way is, to wait for the SDK 6 integration. That sounds more safe and future proof. 😎
from cordova-plugin-firebasex.
I had a go at migrating to Firebase SDK v6 on iOS last night.
I've managed to resolve all the build-time issues so far except one ([[FIRMessaging messaging] connectWithCompletion]]
no longer exists so I need to find what the v6 alternative is).
Once that's done, it should build and run but I expect there'll be some runtime issues I need to diagnose and fix.
from cordova-plugin-firebasex.
Thank you very much for keeping us noted! Appreciate the time and effort you put into this. Hopefully you will have less runtimes issues than expected.
from cordova-plugin-firebasex.
I've resolved that last issue and pushed a preliminary version to the dev branch - you can try it by installing as follows:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#dev
So far the runtime activity looks to be working OK.
I've updated my test project to test APNS on iOS and seems to work OK.
from cordova-plugin-firebasex.
Can't install:
~> cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#dev
Installing "cordova-plugin-firebasex" for ios
Installing "cordova-plugin-cocoapod-supportx" for ios
Installing "cordova-plugin-androidx" for ios
Failed to install 'cordova-plugin-firebasex': Error: Cannot find module 'cordova-lib'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.getAppName (/Users/svzi/development/_own/DummyProject/app/plugins/cordova-plugin-firebasex/scripts/lib/utilities.js:27:24)
at Object.getXcodeProjectPath (/Users/svzi/development/_own/DummyProject/app/plugins/cordova-plugin-firebasex/scripts/ios/helper.js:22:29)
at module.exports (/Users/svzi/development/_own/DummyProject/app/plugins/cordova-plugin-firebasex/scripts/ios/after_plugin_install.js:7:35)
at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:196:18)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:172:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:140:20
Cannot find module 'cordova-lib'
from cordova-plugin-firebasex.
Your test project is using version 3.0.5:
"cordova-plugin-firebasex": "^3.0.5"
Not the dev branch?!
from cordova-plugin-firebasex.
git clone https://github.com/dpa99c/cordova-plugin-firebase-test && cd cordova-plugin-firebase-test
git checkout dev
cordova platform add ios
from cordova-plugin-firebasex.
You'll need to change the package ID in the test project to one which you have control over (i.e. in your Apple Team ID and Firebase project) but if you've got it all setup correctly, you should be able to send a push notification via the Firebase Console and see something like this in the iOS test app:
from cordova-plugin-firebasex.
Thanks, I've tried again and got it to work. The app is building and running right now. That's a very good starting point. But the device log shows that it's not working the way I expect it to work:
WARN: Ionic Native: tried calling Firebase.setScreenName, but the Firebase plugin is not installed.
WARN: Install the Firebase plugin: 'ionic cordova plugin add cordova-plugin-firebase'
...
WARN: Ionic Native: tried calling Firebase.logEvent, but the Firebase plugin is not installed.
WARN: Install the Firebase plugin: 'ionic cordova plugin add cordova-plugin-firebase'
...
I'm using a wrapper in my Ionic app: @ionic-native/firebase
.
It looks like this wrapper is somehow referencing the original plugin:
https://github.com/ionic-team/ionic-native/blob/master/src/%40ionic-native/plugins/firebase/index.ts#L32
Looks like I should get rid of the wrapper. That would probably be the easiest way. At least easier than patching the Ionic-Native Plugin, or what do you think about? I'm using this wrapper only for Notifications and Analytics (two services in total). So I think I will rewrite them, and remove the wrapper.
from cordova-plugin-firebasex.
Nevermind, I just checked my two services in more detail and I discovered only 3 lines of code in total, that use the wrapper. So please don't worry about my questions in the last post. 😂
from cordova-plugin-firebasex.
Any plans to merge the dev-branch into master and make a new NPM release?
from cordova-plugin-firebasex.
I was just keeping it on the dev branch until you can give it a sanity check - if you're happy with it, I'll merge it to master and do an npm release.
from cordova-plugin-firebasex.
I will do some more testing tomorrow morning and let you know about my results! No way to rush things.
from cordova-plugin-firebasex.
👍
from cordova-plugin-firebasex.
To be honest: yesterday my project didn't install the cordova-plugin-firebasex
. I just missed the error messages, but after digging into the Ionic-Native wrapper and some tries to get my few lines of codes running without it, I've noticed that the package simple wasn't installed in my node_modules
folder. For that reason it didn't work, because the plugin wasn't installed.
But as of today I'm still unable to install this branch into my main project. Just to be clear, cloning and running your sample projects works fine. But I need to get this running in my real project. Not sure why it doesn't work.
I've removed all references of cordova-plugin-firebasex
from my package.json
and config.xml
files. After that I run the following commands:
rm -rf platforms/ plugins/ node_modules/
rm package-lock.json
npm install
All fine. Then I add the plugin:
~> cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#dev
Adding cordova-plugin-firebasex to package.json
Saved plugin info for "cordova-plugin-firebasex" to config.xml
Works as well. But when I add the iOS platform:
~> cordova platform add [email protected]
Using cordova-fetch for [email protected]
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.svzi.dummyproject
Name: DummyProject
iOS project created with [email protected]
Installing "cordova-plugin-firebasex" for ios
Installing "cordova-plugin-cocoapod-supportx" for ios
Installing "cordova-plugin-androidx" for ios
Failed to install 'cordova-plugin-firebasex': Error: Cannot find module 'cordova-lib'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.getAppName (/Users/svzi/development/_own/DummyProject/app/plugins/cordova-plugin-firebasex/scripts/lib/utilities.js:27:24)
at Object.getXcodeProjectPath (/Users/svzi/development/_own/DummyProject/app/plugins/cordova-plugin-firebasex/scripts/ios/helper.js:22:29)
at module.exports (/Users/svzi/development/_own/DummyProject/app/plugins/cordova-plugin-firebasex/scripts/ios/after_plugin_install.js:7:35)
at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:196:18)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:172:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:140:20
Cannot find module 'cordova-lib'
Do you have any clue what's going on? Why is your sample project installing this dev branch without any issue, but my main project doesn't work?
from cordova-plugin-firebasex.
I added an explicit dependency on cordova-lib
in the package.json
so I don't understand: npm install
should be installing it to node_modules/cordova-lib
so when the plugin hook script requires it, it should not cause the above error.
Can you check if the cordova-lib
directory is being created in node_modules
and if so what the version is in its package.json
?
I made the dependency on cordova-lib@^9.0.0
- a quite recent version - so maybe there's a version conflict?
You could try running npm list | grep cordova-lib
too see if more than 1 version is referenced.
from cordova-plugin-firebasex.
There is no node_modules/cordova-lib
folder in my project. And btw:
~> cordova --version
8.1.2 ([email protected])
And your request:
~> npm list | grep cordova-lib
npm ERR! missing: cordova-plugin-firebasex@git+https://github.com/dpa99c/cordova-plugin-firebase.git#dev, required by [email protected]
from cordova-plugin-firebasex.
aha! 💡
I wonder if Cordova/NPM is getting confused because the npm package name is cordova-plugin-firebasex
but the Git repo is called cordova-plugin-firebase
?
Either way, it seems not to be happy when installing the plugin from my git repo but happy when installing it from npm.
So, another idea - clone the plugin repo and install the plugin from it locally:
cd /some/tmp/dir/ && git clone https://github.com/dpa99c/cordova-plugin-firebase
cd cordova-plugin-firebase && git checkout dev
cd /your/app/dir && npm install /some/tmp/dir/cordova-plugin-firebase
from cordova-plugin-firebasex.
I've replaced npm install /some/tmp/dir/cordova-plugin-firebase
with cordova plugin add /some/tmp/dir/cordova-plugin-firebase
and it works like a charm!
Btw, the cordova-lib
gets installed into node_modules/cordova-plugin-firebasex/node_modules
and not into node_modules/cordova-lib
as I initially understood.
While running on iOS I've noticed one message in the system log, that I probaby didn't notice before:
PID: 1914, TID: 2763213, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 0
Backtrace:
4 DummyProject 0x00000001006a8d64 __33-[FirebasePlugin setBadgeNumber:]_block_invoke + 104
5 libdispatch.dylib 0x00000001014f36f0 _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x00000001014f4c74 _dispatch_client_callout + 16
7 libdispatch.dylib 0x00000001014f7ad4 _dispatch_queue_override_invoke + 876
8 libdispatch.dylib 0x0000000101505dc8 _dispatch_root_queue_drain + 372
9 libdispatch.dylib 0x00000001015067ac _dispatch_worker_thread2 + 156
10 libsystem_pthread.dylib 0x00000001a7dfd1b4 _pthread_wqthread + 464
11 libsystem_pthread.dylib 0x00000001a7dffcd4 start_wqthread + 4
Should that worry me?
from cordova-plugin-firebasex.
looks like a warning rather than an error - was it preceded by a message something like this?
Main Thread Checker: UI API called on a background thread
Might be a pre-existing issue if the plugin is performing UI operations on a bg thread, but not a major blocker
from cordova-plugin-firebasex.
Yes, the message is preceded by that text. Thanks for the info!
So from my point of view everything seems to work. The only functionality I did not test with my app, is the notification handling. My sends one push notification each day, but in the morning. So I will check tomorrow if that did work. But requesting permissions for notifications worked. So I assume the rest will work as well.
from cordova-plugin-firebasex.
Published to npm as v3.0.6
from cordova-plugin-firebasex.
I'm observing some interesting behavior. I can build and run my code via XCode, but I usually build via cli, to enable some optimizations (minify & aot). For whatever reason, the build via cli hangs at some point (no matter if I try a release build or not):
CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler (in target: DummyProject)
cd /Users/svzi/development/_own/DummyProject/app/platforms/ios
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-nameDummyProject -Onone -enable-batch-mode -enforce-exclusivity=checked -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk............
Do you have any idea why?
from cordova-plugin-firebasex.
No idea why it would hang: I just tried cordova build ios
in my test project and it succeeded - does that work for you?
from cordova-plugin-firebasex.
I just figured out that the build only hangs with the ionic cli, which in some cases should serve as a wrapper around cordova. When I build right away with cordova cli, the build went through. So it seems like it has nothing to do with your changes, but I can't say for sure. 🤷♂️
from cordova-plugin-firebasex.
maybe best thing is to try to create an isolated test project where you can repro the problem then raise as issue against ionic which references that project as evidence
from cordova-plugin-firebasex.
Good idea, will try to! Thanks a lot, again. :-)
from cordova-plugin-firebasex.
Related Issues (20)
- firebasex 16.4.0 caused kotlin version error HOT 1
- com.google.android.recaptcha:recaptcha:18.1.2 security warning HOT 6
- Add rowNonce on signIn w/ Apple response
- Cannot read properties of null (reading '1') HOT 5
- I can't Build my app in Xcode on Apple Silicon
- authenticateUserWithMicrosoft problem due to custom parameter prompt=consent
- setConsent method implementation HOT 2
- Crash in "handleExceptionWithContext" method (rare occurrence)
- Inquiry About Addition of Google Analytics Consent Options for Ad Personalization and User Data HOT 3
- Ionic app not building if I have corodova firbasex installed, if I remove the plugin app will successfully install. HOT 4
- iOS custom or any notification sounds not working - no sounds at all. HOT 1
- Update iOS Firebase SDK component version to v10.23.0, fixes crash on startup HOT 7
- C:\Users\PC\MyApp>cordova run android Checking Java JDK and Android SDK versions ANDROID_HOME=undefined (recommended setting) ANDROID_SDK_ROOT=undefined (DEPRECATED) Using Android SDK: C:\Users\PC\AppData\Local\Android\sdk Subproject Path: CordovaLib Subproject Path: app TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('ENOENT') at process.set [as exitCode] (node:internal/bootstrap/node:123:9) at C:\Users\PC\AppData\Roaming\npm\node_modules\cordova\bin\cordova:32:22 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) HOT 1
- IOS ITMS-91053 errors HOT 7
- why FirebasePlugin.authenticateUserWithGoogle() returns the idToken can pass Firebase verify ? only can pass Google verify HOT 1
- Notification not received with android 12
- Android13 - Start App without logo on tap to background messaging
- Build fail on Cordova-ios 7.1.0 - Xcode 1.15.2 HOT 5
- FirebasePlugin._onAuthIdTokenChange() fires before device ready, FirebasePlugin undefined HOT 12
- Firebase config setup in Ionic App HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-firebasex.