@/utils/utils#openNotificationPermissionActivity JavaScript Examples

The following examples show how to use @/utils/utils#openNotificationPermissionActivity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: tools.js    From lx-music-mobile with Apache License 2.0 6 votes vote down vote up
checkNotificationPermission = async() => {
  const isHide = await getData(notificationTipEnableKey)
  if (isHide != null) return
  const enabled = await isNotificationsEnabled()
  if (enabled) return
  Alert.alert(
    i18n.t('notifications_check_title'),
    i18n.t('notifications_check_tip'),
    [
      {
        text: i18n.t('never_show'),
        onPress: () => {
          setData(notificationTipEnableKey, '1')
          toast(i18n.t('disagree_tip'))
        },
      },
      {
        text: i18n.t('disagree'),
        onPress: () => {
          toast(i18n.t('disagree_tip'))
        },
      },
      {
        text: i18n.t('agree_go'),
        onPress: () => {
          openNotificationPermissionActivity()
        },
      },
    ],
  )
}