Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

IOS_FOREGROUND_ALERT_TYPE is ignored #226

Closed asvetliakov closed 7 years ago

asvetliakov commented 7 years ago

iOS 10.0 (target is 10.0 too) I'm trying to hide banner from push notifications and no matter what i'm doing it's always being displayed.

config.xml

    <plugin name="pushwoosh-cordova-plugin" spec="~6.4.0">
        <variable name="IOS_FOREGROUND_ALERT_TYPE" value="NONE" />
        <variable name="ANDROID_FOREGROUND_PUSH" value="false" />
        <variable name="LOG_LEVEL" value="undefined" />
    </plugin>

I only got following pushwoosh related values in Info.plist

    <key>Pushwoosh_LOG_LEVEL</key>
    <string>DEBUG</string>
    <key>Pushwoosh_ALERT_TYPE</key>
    <string>NONE</string>

I tried to add <key>IOS_FOREGROUND_ALERT_TYPE</key><value>NONE</value> manually to Info.plist but still no luck

Also, is "push-receive" event supposed to be fired when clicking on banner while app in foreground? Unfortunately it doesn't work for me too

wfhm commented 7 years ago

Hi,

<variable name="IOS_FOREGROUND_ALERT_TYPE" value="NONE" />in Cordova config.xml is expected to be <key>Pushwoosh_ALERT_TYPE</key> <string>NONE</string> in resulting info.plist in your native project, so it looks like everything worked just fine. Please note that it should only disable banners popping in foreground, in other states it will still be shown.

Also, is "push-receive" event supposed to be fired when clicking on banner while app in foreground? Unfortunately it doesn't work for me too

It is fired when a notification is received on a device. Clicking on a notification should trigger "push-notification" event.

asvetliakov commented 7 years ago

Please note that it should only disable banners popping in foreground, in other states it will still be shown.

The problem the banner is popping in foreground regardless what i set in config.xml/info.plist

Clicking on a notification should trigger "push-notification" event.

It doesn't trigger it by clicking on foreground banner.

I've a chat app and i need to display banner for both foreground/background/closed state. If i'm trying to use local notifications for displaying banner in foreground, then i'm getting second banner from push plugin. If i'm trying to use just push plugin for both foreground/background notifications then click events from push plugin aren't working when app is in foreground.

wfhm commented 7 years ago

@asvetliakov

Strangely enough, we were not able to reproduce any of these issues. Could you please try our Sample app and let us know if it works for you? I have just tested it and "push-notification" event was triggered, as well as no banner was shown with <variable name="IOS_FOREGROUND_ALERT_TYPE" value="NONE" /> added to config.xml