I'm using https://github.com/fechanique/cordova-plugin-fcm plugin and it works great for both platforms.
However, on iOS, the notification permission pop up is invoked right at the launch of the app, and I want it to appear only after the login process is complete.
I have zero knowledge in objective-C so i can't override the classes.
Can anyone please help?
Found a solution in case anyone encounters the same problem in the future...
https://github.com/jjrom/cordova-plugin-fcm/commit/4fedc72b2d94d85a67f6266aef13e774b7a16bfe
Related
What are some possible reasons that UNUserNotificationCenter.current().requestAuthorization might not prompt?
I have some users that are not receiving the prompt for permission at all. I've even tried to change the app bundle Id in TestFlight to see if they would get the prompt but to no avail.
I've tried resetting permission via https://developer.apple.com/library/archive/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42 as well.
Notification permission settings does not get listed within the app settings on iOS which leads me to believe it isn't necessarily rejected.
Any help would be greatly appreciated. I don't think this is a code issue as the call is fairly straightforward.
Asking for provisional permissions causes the permission prompt for notifications not to show on iOS < 12.
If the user has rejected the permission for your app before, then the dialog won't show either.
Even though the problem was caused by something silly; I think it would still be worthwhile to share the problem resolution.
We have a WK WebView iOS app. On our Angular side, we try to detect whether or not the environment is currently iOS native app before trying to prompt the user for permission. We do this detection by setting a flag in local storage (I don't really have all the details as it is not my code - I'm just the reviewer). Between the loading of the native app, the WebView and angular code, we couldn't reliably ensure that things are handled synchronously.
The detection failed - so we never prompt the user.
Thanks again for the help.
Recently upgraded to unity 2017.1 and facebook sdk 7.10 and the login dialogue no longer displays on device when making the FB.LoginWithReadPermissions(..., ...) call. I do not receive a response in my callback function and the dialogue never displays. Nothing seems to happen, no logs, no errors.
This was working in Unity 5.5.3 w/ a previous version of the facebook sdk. I have noticed that if I include facebooks sample scene and I am able to login through the sample scene. This makes me believe something has changed with the implementation that is causing my project to block the dialogue from being displayed.
Any suggestions would be appreciated.
EDIT: Forgot to mention this was an iOS build.
I've found the problem. Unity introduced a bug: https://issuetracker.unity3d.com/issues/ios-cannot-open-url-when-launching-fblogin-through-unity-facebook-sdk-in-portrait-only-autorotate-state
in version 5.6.2p4 that prevents all native ios dialogues from popping up if you allow the device to autorotate. I resolved the problem by removing the code:
Screen.orientation = ScreenOrientation.AutoRotation;
Hope this helps someone else because this was a nightmare for me to track down.
EDIT: Wanted to also mention that the setting for auto rotate cannot be selected in the player settings for iOS either.
I have to have handle system pop up on iOS. I have tried below solution but they do not help:
1. driver.findElement(By.name("OK")).click();
2. capabilities.setCapability("autoAcceptAlerts", true);
These solution do not help.
I went through http://bitbar.com/appium-tip-9-how-to-automatically-dismiss-dialogs-and-autoaccept-alerts/ which says to use image recognition to handle alerts.
Is there any solution which can help me handle these pop-ups. Or if anyone is aware of any script which can be called at time of popup appearance to handle these pop ups.
Also, I came to know that appium can handle system pop-ups for ios 10. Is there any solution for lower versions.
I installed appium 1.6.3 and tested for handling ios system pop ups and I was able to click on Install button for one of the pop up using element.click() method.
I would like to have a response from someone else and confirm if this is something that has changed on iOS8 or if I have another problem in my project.
I was trying to move the notification permission popup and call it later, but after several test I see I cannot do that with iOS8, it works fine on iOS7.
And I have the following confirmations:
-On iOS8 there's no need to call "registerForRemoteNotifications", the popup appears anyway. (it was "registerForRemoteNotificationsTypes" before but now is deprecated on iOS8 and there seems to be a "registerForRemoteNotifications" that is referenced on the official documentation but there's no documentation for that new method specifically)
(https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UIApplication_Class/index.html)
-I removed the entitlements from my app and the popup also appears, so probably it takes that info from the prov instead of descriptor.
Any though on this? anyone can confirm if this is true?
Thanks
There's not so much documentation about this, but after watching an official video from Apple, and reading more about all these new functionalities for notifications on iOS8, I could understand what's happening with the popup.
First I was using AIR 14 that had a bug for iOS8 and the permission popup appeared even without calling any specific native method in UIApplication, that was fixed on AIR 15.0
Also, there's no more permission popup for remote notification on iOS8, users can receive notifications by default, and they can disable that from the device settings (anyway we should request the token as usual).
The permission popup that we see in iOS8 is for local notifications, and it appears when we call this method:
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
All that explains the weird behavior that I had before, and actually I could clarify and fix this issue.
I use phone-gap plugin for APN and xcode 5.
https://github.com/phonegap-build/PushPlugin
I put a breakpoint at each function in the plugin.
For some reason when i send a push notification not even single break point are hit.
But the notification received on my device.
Any explanation for this.
Thanks in advance.
There are some things you could check:
Did you set them in in xcode or in the safari debugger? Actually I am not sure if the first option would ever work at all. Have any breakpoints worked in your application?
Is the app running in the foreground when the notification is received? As far as I know, no code is executed on receiving the message if the app is running in the background, so this might also be a reason for not hitting any breakpoints.