-
Notifications
You must be signed in to change notification settings - Fork 40
[MOB-12260] create-embedded-tab-in-example-app #741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: loren/embedded/master
Are you sure you want to change the base?
[MOB-12260] create-embedded-tab-in-example-app #741
Conversation
|
Diff Coverage: The code coverage on the diff in this pull request is 100.0%. Total Coverage: This PR will decrease coverage by 0.27%. File Coverage Changes
🛟 Help
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more. |
1 new issue
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more. |
…' into jwt/MOB-12298-new-improve-logger
…OB-12260-create-embedded-tab-in-example-app
| const requestNotificationPermission = async () => { | ||
| if (Platform.OS === 'android') { | ||
| const apiLevel = Platform.Version; // Get the Android API level | ||
|
|
||
| if (apiLevel >= 33) { | ||
| // Check if Android 13 or higher | ||
| try { | ||
| const granted = await PermissionsAndroid.request( | ||
| PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS, | ||
| { | ||
| title: 'Notification Permission', | ||
| message: | ||
| 'This app needs access to your notifications for push, in-app messages, embedded messages and more.', | ||
| buttonNeutral: 'Ask Me Later', | ||
| buttonNegative: 'Cancel', | ||
| buttonPositive: 'OK', | ||
| } | ||
| ); | ||
| if (granted === PermissionsAndroid.RESULTS.GRANTED) { | ||
| console.log('Notification permission granted'); | ||
| } else { | ||
| console.log('Notification permission denied'); | ||
| } | ||
| } catch (err) { | ||
| console.warn(err); | ||
| } | ||
| } else { | ||
| // For Android versions below 13, notification permission is generally not required | ||
| // or is automatically granted upon app installation. | ||
| console.log( | ||
| 'Notification permission not required for this Android version.' | ||
| ); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔹 JIRA Ticket(s) if any
✏️ Description
Adds the embedded tab to example app
Tests
yarn ios) or android (yarn android)