Skip to content

Commit f17f070

Browse files
author
Harun.Karahan
committed
chore: empty string issue fixed on ios
1 parent d954b97 commit f17f070

File tree

10 files changed

+151
-107
lines changed

10 files changed

+151
-107
lines changed

configs/e2e/native_dependencies.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"react-native-device-info": "14.0.4",
55
"react-native-action-button": "2.8.5",
66
"react-native-material-menu": "1.2.0",
7-
"react-native-linear-gradient": "2.5.6",
7+
"react-native-linear-gradient": "3.0.0-alpha.1",
88
"@react-native-community/netinfo": "11.4.1",
99
"react-native-svg": "15.7.1",
1010
"react-native-system-navigation-bar": "2.6.3",

packages/jsActions/mobile-resources-native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"react-native-localize": "3.2.1",
4141
"react-native-permissions": "4.1.5",
4242
"react-native-schedule-exact-alarm-permission": "^0.1.3",
43-
"react-native-sound": "0.11.0",
43+
"react-native-track-player": "^4.1.1",
4444
"url-parse": "^1.4.7"
4545
},
4646
"devDependencies": {

packages/jsActions/mobile-resources-native/src/notifications/CancelAllScheduledNotifications.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import { NativeModules, Platform } from "react-native";
8+
import { NativeModules } from "react-native";
99
import notifee from "@notifee/react-native";
1010

1111
// BEGIN EXTRA CODE
@@ -18,9 +18,8 @@ import notifee from "@notifee/react-native";
1818
export async function CancelAllScheduledNotifications(): Promise<void> {
1919
// BEGIN USER CODE
2020
// Documentation https://github.com/invertase/notifee
21-
const isIOS = Platform.OS === "ios";
22-
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
23-
return Promise.reject(new Error("Notifications module is not available in your app"));
21+
if (NativeModules && !NativeModules.NotifeeApiModule) {
22+
return Promise.reject(new Error("Notifee native module is not available in your app"));
2423
}
2524

2625
notifee.cancelAllNotifications();

packages/jsActions/mobile-resources-native/src/notifications/CancelScheduledNotification.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import { NativeModules, Platform } from "react-native";
8+
import { NativeModules } from "react-native";
99
import notifee from "@notifee/react-native";
1010

1111
// BEGIN EXTRA CODE
@@ -18,9 +18,8 @@ import notifee from "@notifee/react-native";
1818
export async function CancelScheduledNotification(notificationId?: string): Promise<void> {
1919
// BEGIN USER CODE
2020
// Documentation Documentation https://github.com/invertase/notifee
21-
const isIOS = Platform.OS === "ios";
22-
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
23-
return Promise.reject(new Error("Notifications module is not available in your app"));
21+
if (NativeModules && !NativeModules.NotifeeApiModule) {
22+
return Promise.reject(new Error("Notifee native module is not available in your app"));
2423
}
2524

2625
if (!notificationId) {

packages/jsActions/mobile-resources-native/src/notifications/ClearAllDeliveredNotifications.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import { NativeModules, Platform } from "react-native";
8+
import { NativeModules } from "react-native";
99
import notifee from "@notifee/react-native";
1010

1111
// BEGIN EXTRA CODE
@@ -18,9 +18,8 @@ import notifee from "@notifee/react-native";
1818
export async function ClearAllDeliveredNotifications(): Promise<void> {
1919
// BEGIN USER CODE
2020
// Documentation Documentation https://github.com/invertase/notifee
21-
const isIOS = Platform.OS === "ios";
22-
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
23-
return Promise.reject(new Error("Notifications module is not available in your app"));
21+
if (NativeModules && !NativeModules.NotifeeApiModule) {
22+
return Promise.reject(new Error("Notifee native module is not available in your app"));
2423
}
2524

2625
notifee.cancelAllNotifications();

packages/jsActions/mobile-resources-native/src/notifications/DisplayNotification.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export async function DisplayNotification(
4545
android: {
4646
channelId,
4747
// smallIcon: "ic_notification",
48-
sound: playSound ? "default" : undefined
48+
...(playSound ? { sound: "default" } : {})
4949
},
5050
ios: {
51-
sound: playSound ? "default" : undefined
51+
...(playSound ? { sound: "default" } : {})
5252
}
5353
};
5454

packages/jsActions/mobile-resources-native/src/notifications/ScheduleNotification.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ export async function ScheduleNotification(
5858
android: {
5959
channelId,
6060
smallIcon: "ic_notification",
61-
sound: playSound ? "default" : undefined
61+
...(playSound ? { sound: "default" } : {})
6262
},
6363
ios: {
64-
sound: !!playSound
64+
...(playSound ? { sound: "default" } : {})
6565
}
6666
};
6767

packages/jsActions/mobile-resources-native/src/notifications/SetBadgeNumber.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
88
import { Big } from "big.js";
9-
import { NativeModules, Platform } from "react-native";
9+
import { NativeModules } from "react-native";
1010
import notifee from "@notifee/react-native";
1111

1212
// BEGIN EXTRA CODE
@@ -20,9 +20,8 @@ export async function SetBadgeNumber(badgeNumber?: Big): Promise<void> {
2020
// BEGIN USER CODE
2121
// Documentation Documentation https://github.com/invertase/notifee
2222

23-
const isIOS = Platform.OS === "ios";
24-
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
25-
return Promise.reject(new Error("Notifications module is not available in your app"));
23+
if (NativeModules && !NativeModules.NotifeeApiModule) {
24+
return Promise.reject(new Error("Notifee native module is not available in your app"));
2625
}
2726

2827
if (!badgeNumber) {

0 commit comments

Comments
 (0)