havesource / cordova-plugin-push

Register and receive push notifications
MIT License
149 stars 284 forks source link

iOS push notification permission dialog doesn't wok on iPadOS 15.0.2 #167

Open gkravas opened 2 years ago

gkravas commented 2 years ago

Bug Report

When I request push notification permission dialog on iPadOS 15.0.2 the dialog doesn't show and I cannot enable push notifications. The code works fine on iPads below version iPadOS 15.0.2. It also works on all iOS versions til now (15.3.1).

Platform and Version

iPadOS 15.0.2

cordova info Printout

Cordova Packages:

cli: 11.0.0
    common: 4.0.2
    create: 4.0.0
    lib: 11.0.0
        common: 4.0.2
        fetch: 3.0.1
        serve: 4.0.0

Project Installed Platforms:

ios: 6.2.0

Project Installed Plugins:

@havesource/cordova-plugin-push: 3.0.1-dev.0
cordova-plugin-advanced-http: 3.2.2
cordova-plugin-badge: 0.8.8
cordova-plugin-dialogs: 2.0.2
cordova-plugin-file: 6.0.2
cordova-plugin-inappbrowser: 5.0.0
cordova-plugin-network-information: 3.0.0
cordova-plugin-splashscreen: 6.0.0
cordova-plugin-statusbar: 2.4.3
cordova-plugin-whitelist: 1.3.4
cordova-plugin-x-socialsharing: 6.0.3
cordova-support-google-services: 1.4.1
es6-promise-plugin: 4.2.2

Environment:

OS: macOS Monterey 12.1 (21C52) (darwin 21.2.0) x64
Node: v12.18.1
npm: 6.14.5

ios Environment:

xcodebuild:

Xcode 13.2.1 Build version 13C100

Project Setting Files:

config.xml:

<?xml version="1.0" encoding="UTF-8"?> <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "gr.macropolis.apps.macropolis" version = "1.0.13">

<!-- https://build.phonegap.com/docs/config-xml -->

<name>MacroPolis</name>

<description>MacroPolis Newsletter App</description>

<author href="http://www.macropolis.gr/" email="info@macropolis.gr">MacroPolis</author>
<icon src="www/phonegap-build-images/android/mdpi.png" gap:platform="android" gap:density="mdpi" />
<icon src="www/phonegap-build-images/android/hdpi.png" gap:platform="android" gap:density="hdpi" />
<icon src="www/phonegap-build-images/android/xhdpi.png" gap:platform="android" gap:density="xhdpi" />
<!-- iOS 8.0+ -->
<!-- iPhone 6 Plus  -->
<icon src="www/phonegap-build-images/ios/180.png" width="180" height="180" gap:platform="ios" />
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch  -->
<icon src="www/phonegap-build-images/ios/60.png" width="60" height="60" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/120.png" width="120" height="120" gap:platform="ios" />
<!-- iPad -->
<icon src="www/phonegap-build-images/ios/76.png" width="76" height="76" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/152.png" width="152" height="152" gap:platform="ios" />
<!-- Spotlight Icon -->
<icon src="www/phonegap-build-images/ios/40.png" width="40" height="40" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/80.png" width="80" height="80" gap:platform="ios" />
<!-- iOS 6.1 -->
<!-- iPhone / iPod Touch -->
<icon src="www/phonegap-build-images/ios/57.png" width="57" height="57" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/114.png" width="114" height="114" gap:platform="ios" />
<!-- iPad -->
<icon src="www/phonegap-build-images/ios/72.png" width="72" height="72" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/144.png" width="144" height="144" gap:platform="ios" />
<!-- iPad Pro -->
<icon src="www/phonegap-build-images/ios/167.png" width="167" height="167" gap:platform="ios" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="www/phonegap-build-images/ios/29.png" width="29" height="29" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/58.png" width="58" height="58" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/87.png" width="87" height="87" gap:platform="ios" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="www/phonegap-build-images/ios/50.png" width="50" height="50" gap:platform="ios" />
<icon src="www/phonegap-build-images/ios/100.png" width="100" height="100" gap:platform="ios" />
<!-- iTunes Marketing Image -->
<icon src="www/phonegap-build-images/ios/1024.png" width="1024" height="1024" gap:platform="ios" />
<gap:splash src="www/phonegap-build-images/splash/screen-mdpi.9.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="www/phonegap-build-images/splash/screen-hdpi.9.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="www/phonegap-build-images/splash/screen-xhdpi.9.png" gap:platform="android" gap:density="xhdpi" />
<gap:splash src="www/phonegap-build-images/splash/Default_at_2x.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="www/phonegap-build-images/splash/Default_568h_at_2x.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="www/phonegap-build-images/splash/Default-Landscape.png" gap:platform="ios" width="1024" height="768" />
<gap:splash src="www/phonegap-build-images/splash/Default-Portrait.png" gap:platform="ios" width="768" height="1024" />
<gap:splash src="www/phonegap-build-images/splash/Default_at_2x-large.png" gap:platform="ios" width="750" height="1334" />
<gap:splash src="www/phonegap-build-images/splash/Default_at_2x-extra-large.png" gap:platform="ios" width="1242" height="2208" />
<gap:splash src="www/phonegap-build-images/splash/Default-Portrait_at_2x.png" gap:platform="ios" width="1536" height="2008" />
<gap:splash src="www/phonegap-build-images/splash/Default-Landscape_at_2x.png" gap:platform="ios" width="2048" height="1496" />

<!-- both landscape and portrait are enabled -->
<preference name="orientation" value="default" />

<!-- android stuff -->  
<preference name="android-installLocation" value="auto" />

<!-- ios stuff -->
<preference name="DisallowOverscroll" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />

<!-- permissions -->
<feature name="http://api.phonegap.com/1.0/network" />

<!-- network permissions -->
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

<gap:plugin name="cordova-plugin-advanced-http" source="npm" /> 
<gap:plugin name="cordova-plugin-splashscreen" source="npm" /> 
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreenDelay" value="5000" />

<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
<gap:plugin name="phonegap-plugin-push" source="npm" spec="1.8.4">
    <param name="SENDER_ID" value="111111111111111" />
</gap:plugin>

<!-- MACM-73 social sharing buttons -->
<gap:plugin name="cordova-plugin-x-socialsharing" source="npm" />

<!-- MACM-16 -->
<gap:plugin name="cordova-plugin-statusbar" source="npm" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />

<gap:plugin name="cordova-plugin-network-information" source="npm" /> 
<gap:plugin name="cordova-plugin-dialogs" source="npm" /> 

<gap:platform name="android" />
<gap:platform name="ios" />

<gap:plugin name="cordova-plugin-badge" source="npm" />

package.json:

--- Start of Cordova JSON Snippet --- { "plugins": { "cordova-plugin-whitelist": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-network-information": {}, "cordova-plugin-dialogs": {}, "cordova-plugin-badge": {}, "cordova-plugin-x-socialsharing": { "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.", "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly." }, "@havesource/cordova-plugin-push": { "IOS_FIREBASE_MESSAGING_VERSION": "~> 6.32.2" }, "cordova-support-google-services": {} }, "variables": { "SENDER_ID": "1884942702" }, "platforms": [ "android", "ios" ] }

erisu commented 5 days ago

I am unable to reproduce this issue but I also do not own a physical iPad.

I tried testing on a simulator but the lowest version it has was 15.5.

I also testing with the latest release of this plugin 5.0.0.

With the following example, the permission dialog appeared.

const push = PushNotification.init({
    android: {},
    ios: {
        alert: true,
        badge: true,
        sound: true
    }
});