How can i check push notification permission for both ios and android in react native?
up vote
1
down vote
favorite
I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.
javascript android ios react-native
New contributor
add a comment |
up vote
1
down vote
favorite
I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.
javascript android ios react-native
New contributor
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.
javascript android ios react-native
New contributor
I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.
javascript android ios react-native
javascript android ios react-native
New contributor
New contributor
New contributor
asked 20 hours ago
mayank goyal
61
61
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You can check react-native-permissions npm. After integrating you can use it like:
componentDidMount() {
Permissions.check('notification').then(response => {
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({ photoPermission: response })
})
}
There is another library that can help (I have not used it).
There is also native implementation for as suggested here.
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can check react-native-permissions npm. After integrating you can use it like:
componentDidMount() {
Permissions.check('notification').then(response => {
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({ photoPermission: response })
})
}
There is another library that can help (I have not used it).
There is also native implementation for as suggested here.
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
add a comment |
up vote
0
down vote
You can check react-native-permissions npm. After integrating you can use it like:
componentDidMount() {
Permissions.check('notification').then(response => {
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({ photoPermission: response })
})
}
There is another library that can help (I have not used it).
There is also native implementation for as suggested here.
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
add a comment |
up vote
0
down vote
up vote
0
down vote
You can check react-native-permissions npm. After integrating you can use it like:
componentDidMount() {
Permissions.check('notification').then(response => {
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({ photoPermission: response })
})
}
There is another library that can help (I have not used it).
There is also native implementation for as suggested here.
You can check react-native-permissions npm. After integrating you can use it like:
componentDidMount() {
Permissions.check('notification').then(response => {
// Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
this.setState({ photoPermission: response })
})
}
There is another library that can help (I have not used it).
There is also native implementation for as suggested here.
answered 20 hours ago
rptwsthi
8,48385292
8,48385292
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
add a comment |
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
but 'notification' permission using react-native-permission only works with ios and not with android.
– mayank goyal
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
That is why added "another library".
– rptwsthi
20 hours ago
add a comment |
mayank goyal is a new contributor. Be nice, and check out our Code of Conduct.
mayank goyal is a new contributor. Be nice, and check out our Code of Conduct.
mayank goyal is a new contributor. Be nice, and check out our Code of Conduct.
mayank goyal is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371380%2fhow-can-i-check-push-notification-permission-for-both-ios-and-android-in-react-n%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown