I'm trying to delay the popup on iOS to not appear until it's better in our user flow as opposed to the first time the user opens the app. Any suggestions on how to accomplish this?
@maxmatthews I recently updated the Firebase iOS SDK to the latest version. Please install the plugin via github and see if it helps with anything.
Still the same problem. Just removed and readded the cordova plugin from the git repo and still the same issue. Even without calling window.FirebasePlugin anywhere in my code base, as soon as I still in the plugin and run on iOS, I get the grant permission dialog.
There's this comment in AppDelegate+FirebasePlugin.m (line 47):
// Register for remote notifications. This shows a permission dialog on first run, to
// show the dialog at a more appropriate time move this registration accordingly.
but I don't want to modify the .m file and have it overriden on an update. Would be nice if I could set something in my config.xml that was something like FirebasePluginiOSAutoShowNotificationDialog=false That way it doesn't break backwards compatibility for people who are relying on the dialog autoshowing. Unfortunately that's a little out of my cordova knowledge to submit a pull request.
@maxmatthews agreed, a new variable should be added to the plugin to configure this functionality. The README should be updated to include this new variable with a note that it is only used for ios. If possible, it should also be used for android.
<plugin name="cordova-plugin-firebase" spec="^1.0.0">
<variable name="AUTO_SHOW_NOTIFICATION_DIALOG" value="false"/>
</plugin>
@soumak77 does this solution work fine for you ? It still ask permission on launch for me... Shame for my UX scheme ^^
@maxauger I think that was more a spec on how it should be implemented. The plugin hasn鈥檛 been updated yet to use that config line.
No need for a config-entry
https://github.com/arnesson/cordova-plugin-firebase/issues/664
This lines should be deleted asap. It's a unnecessary BC. Whoever wants to have a instant prompt dialog can just call "grantPermission" on deviceready. This is a useless overhead
It鈥榮 fixed, please close @soumak77
Just use grantPermission() if you want to have it at startup
Thanks a lot you for your efficiency !!
It still asks for permissions on startup even after removing everything. It is such a bad experience
Its not. You may have not installed the right version
@Hirbod here is the details of my install .. I have @ionicNative-firebase which is ^4.9.0 and my cordova-plugin-firebase is spec ^1.0.3. Is this not right?
As far as I can see from the commit history, my changes were integrated into version 1.0.4. I am using the same version and I do not have the startup dialog.
yeah, i updated to the latest version and i don't have the issue now
Most helpful comment
@maxmatthews agreed, a new variable should be added to the plugin to configure this functionality. The README should be updated to include this new variable with a note that it is only used for ios. If possible, it should also be used for android.