guyromb / cordova-open-native-settings

Plugin to open native screens of iOS/android settings (maintained, end-2020)
http://gsrweb.net
MIT License
113 stars 105 forks source link

Open notification settings for particular app #21

Closed goranprijic closed 6 years ago

goranprijic commented 6 years ago

Hi there

Is there any way to open notification settings for particular app like described here https://github.com/phynet/iOS-URL-Schemes#open-other-apps-notification-settings ?

Thanks in advance

guyromb commented 6 years ago

It is possible, @goranprijic . Not much work, maybe you can do it and make a pull request? UIApplication.shared.openURL(NSURL(string:"App-prefs:root=NOTIFICATIONS_ID&path=APP_BUNDLE_ID")! as URL) APP_BUNDLE_ID for example com.microsoft.Office.Word

guyromb commented 6 years ago

https://github.com/guyromb/Cordova-open-native-settings/pull/22 support added for Android

guyromb commented 6 years ago

@goranprijic did it work? https://github.com/goranprijic/Cordova-open-native-settings/commit/5503b2ca2ab5804d1b2b81ed6af3d91413eee84c

goranprijic commented 6 years ago

Unfortunately, it doesn't work... But maybe I'm doing something wrong there since I'm not really familiar with cordova plugins development

luigi37 commented 6 years ago

Same here: tried window.cordova.plugins.settings.open("notification_id", function() but it's not working... nothing happens

Below some log, not sure if it helps:

12-05 21:00:53.558  4406  5430 D AppWidgetServiceImpl: updateAppWidgetInstanceLocked, full update widget = AppWidgetId{8:Host{HostId{user:0, app:10061, hostId:1024, pkg:com.sec.android.app.launcher}}:Provider{ProviderId{user:0, app:10218, cmp:ComponentInfo{jp.co.intri.second.clock/jp.co.intri.second.clock.ClockWidget1}}}}
12-05 21:00:53.559  4406  4406 D AppWidgetServiceImpl: handleNotifyUpdateAppWidget, w = AppWidgetId{8:Host{HostId{user:0, app:10061, hostId:1024, pkg:com.sec.android.app.launcher}}:Provider{ProviderId{user:0, app:10218, cmp:ComponentInfo{jp.co.intri.second.clock/jp.co.intri.second.clock.ClockWidget1}}}}, isBlackListWidget = false, mIsPolicySeqNum = true, mIsPolicyTooLarge = true, mIsPolicySkipMerge = true
12-05 21:00:53.559  4406  4406 D AppWidgetServiceImpl: handleNotifyUpdateAppWidget, seqNumber = 8
12-05 21:00:54.546  4406  4617 D SamsungAlarmManager: Expired : 8
12-05 21:00:54.547  4406  4617 I SamsungAlarmManager: setLocked to kernel - T:3 / 20171205T210100, SetElapsed=111854721, nowELAPSED=111849269
12-05 21:00:54.548  4406  4617 V SamsungAlarmManager: Sending to uid : 10218 action=null alarm=Alarm{543bfae type 1 when 1512504054546 jp.co.intri.second.clock}
12-05 21:00:54.559  4406 21864 D SamsungAlarmManager: setExact Intent (T:1/F:1/AC:false) 20171205T210055 - CU:10218/CP:19521
12-05 21:00:54.560  4406 21864 I SamsungAlarmManager: setLocked to kernel - T:3 / 20171205T210055, SetElapsed=111850274, nowELAPSED=111849282
12-05 21:00:54.570  4406  8326 D AppWidgetServiceImpl: updateAppWidgetInstanceLocked, full update widget = AppWidgetId{8:Host{HostId{user:0, app:10061, hostId:1024, pkg:com.sec.android.app.launcher}}:Provider{ProviderId{user:0, app:10218, cmp:ComponentInfo{jp.co.intri.second.clock/jp.co.intri.second.clock.ClockWidget1}}}}
12-05 21:00:54.572  4406  4406 D AppWidgetServiceImpl: handleNotifyUpdateAppWidget, w = AppWidgetId{8:Host{HostId{user:0, app:10061, hostId:1024, pkg:com.sec.android.app.launcher}}:Provider{ProviderId{user:0, app:10218, cmp:ComponentInfo{jp.co.intri.second.clock/jp.co.intri.second.clock.ClockWidget1}}}}, isBlackListWidget = false, mIsPolicySeqNum = true, mIsPolicyTooLarge = true, mIsPolicySkipMerge = true
12-05 21:00:54.572  4406  4406 D AppWidgetServiceImpl: handleNotifyUpdateAppWidget, seqNumber = 8
12-05 21:00:55.055  4089  4571 E NetlinkEvent: NetlinkEvent::FindParam(): Parameter 'LABEL' not found
12-05 21:00:55.089  4406  4406 I ActivityManager: KPU : put [com.sec.android.app.sbrowser] : 7142 K
12-05 21:00:55.089  4406  4406 I ActivityManager: Killing 5847:com.sec.android.app.sbrowser/u0a123 (adj 906): DHA:empty #25
12-05 21:00:55.121  4406 12804 D ActivityManager: cleanUpApplicationRecord -- 5847
12-05 21:00:55.122  5412  5425 D ForegroundUtils: could not check pending caller
12-05 21:00:55.272  4829  4996 I System.out: Broadcasting: Intent { act=com.sec.intent.action.SARDEVICE_CP flg=0x10000000 launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } (has extras) 
keithdmoore commented 6 years ago

Once this is working, consider updating the README to reflect the new functionality for Android.

PriceFallin commented 6 years ago

For iOS I got this to work by following @guyromb's advice by adding the bundle ID to the end of the path.

Example: result = [self do_open:[prefix stringByAppendingString:@"root=NOTIFICATIONS_ID&path=com.myapp.project"]];

You'll need to reload the plugin though after making the changes. I typically do that by removing all references to the app in ios.json from the iOS platform folder, then perform the build command.

guyromb commented 6 years ago

Some fix merged https://github.com/guyromb/Cordova-open-native-settings/pull/28

timbru31 commented 6 years ago

@guyromb can you make a new release with this iOS 11 fix? That would be awesome!

guyromb commented 6 years ago

On it, @timbru31 !

devhopeok commented 6 years ago

@guyromb I'm also having a issue to open notification setting of particular app on iOS 11. It's working well on iOS 10. Can you please make a new release with this iOS 11 fix asap? thanks.

guyromb commented 6 years ago

@timbru31 @gitofwebmobiledev Published a new version. Can you please confirm it works for you?

dhariniAcube commented 4 years ago

@guyromb I am also facing the same issue to open notification setting of particular app even after upgraded to new version. Any update on this issue?

a-ridley commented 3 years ago

@guyromb Similar issue as @dhariniAcube Any update? Thanks!