Skip to content

Commit

Permalink
Automatic update of widgets, themes and modules
Browse files Browse the repository at this point in the history
  • Loading branch information
uicontent committed Sep 17, 2024
1 parent 073d55b commit a4f8693
Show file tree
Hide file tree
Showing 443 changed files with 14,837 additions and 36,900 deletions.
Binary file modified StarterApp_NativeMobile.mpr
Binary file not shown.
Binary file removed javascriptsource/nativemobileresources/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"nativeDependencies": {
"react-native-blob-util": "0.16.2",
"react-native-file-viewer": "2.1.5"
"react-native-file-viewer": "2.1.5",
"react-native-blob-util": "0.16.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,37 @@ import messaging from '@react-native-firebase/messaging';
*/
async function RequestNotificationPermission() {
// BEGIN USER CODE
// Documentation https://rnfirebase.io/docs/v5.x.x/notifications/receiving-notifications
// Documentation https://rnfirebase.io/messaging/usage
if (NativeModules && !NativeModules.RNFBMessagingModule) {
return Promise.reject(new Error("Firebase module is not available in your app"));
}
if (Platform.OS === "android") {
return PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
.then(() => {
return true;
})
.catch(() => {
try {
const granted = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS);
return granted === PermissionsAndroid.RESULTS.GRANTED;
}
catch (error) {
console.error("Failed to request permission on Android", error);
return false;
}
}
try {
const authStatus = await messaging().requestPermission();
const enabled = authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
authStatus === messaging.AuthorizationStatus.PROVISIONAL;
if (!enabled) {
return false;
});
}
if (!messaging().isDeviceRegisteredForRemoteMessages) {
await messaging().registerDeviceForRemoteMessages();
return true;
}
return true;
}
catch (error) {
console.error("Failed to request permission on iOS", error);
return false;
}
return messaging()
.requestPermission()
.then(() => Platform.OS === "ios" && !messaging().isDeviceRegisteredForRemoteMessages
? messaging()
.registerDeviceForRemoteMessages()
.then(() => true)
: true)
.catch(() => false);
// END USER CODE
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"nativeDependencies": {
"react-native-localize": "1.4.2",
"react-native-permissions": "3.3.1",
"react-native-image-picker": "5.0.1"
"react-native-image-picker": "5.0.1",
"react-native-permissions": "3.3.1"
}
}

Large diffs are not rendered by default.

Loading

0 comments on commit a4f8693

Please sign in to comment.