简体   繁体   中英

How to not let user open the app by clicking the notification?

I think it is weird to ask but I was wondering if it is possible to have a readonly notification inside the notification centre. "Readonly" means when you tap on the notification there will be nothing happens. The related app won't be launched and the only option is to delete/clear the that notification.

Thanks

It's not possible. Notifications can always be acted on.

Well, for Alerts style notifications there's an option to supply null action-loc-key which removes the View button (leaving only a Cancel button that dismisses the notification). Perhaps the behavior is similar for notifications in the notifications center.

{"aps":
     {"alert":{"body":"Some message",
               "action-loc-key":null}
     }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM