apps-sdk 1.0.65 → 1.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -0
- package/package.json +1 -1
- package/src/libraries/Notifications.js +10 -0
- package/src/libraries/Rating.js +1 -1
- package/types/index.d.ts +3 -0
package/index.js
CHANGED
|
@@ -9,11 +9,16 @@ class AppsSDK {
|
|
|
9
9
|
return expoToken
|
|
10
10
|
})
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
getNotificationsStatus = async () => {
|
|
14
|
+
return await NotificationsPush.getPushNotificationsStatus();
|
|
15
|
+
}
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
const Core = new AppsSDK();
|
|
15
19
|
export default {
|
|
16
20
|
initializePushNotifications: Core.initializePushNotifications,
|
|
21
|
+
getPushNotificationsStatus: Core.getNotificationsStatus,
|
|
17
22
|
networking: Networking,
|
|
18
23
|
storage: Storage,
|
|
19
24
|
session: Session,
|
|
@@ -23,4 +28,5 @@ export default {
|
|
|
23
28
|
adjust: AdJust,
|
|
24
29
|
tracking: TrackingTransparency,
|
|
25
30
|
paywall: PayWall,
|
|
31
|
+
notifications: NotificationsPush,
|
|
26
32
|
}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import * as Notifications from 'expo-notifications';
|
|
|
4
4
|
import * as Device from 'expo-device';
|
|
5
5
|
import Constants from 'expo-constants';
|
|
6
6
|
import { default as Networking } from './Networking';
|
|
7
|
+
import { default as Storage } from './Storage';
|
|
7
8
|
|
|
8
9
|
class NotificationsPush {
|
|
9
10
|
initialize = async () => {
|
|
@@ -56,6 +57,8 @@ class NotificationsPush {
|
|
|
56
57
|
if (finalStatus === 'granted') {
|
|
57
58
|
token = (await Notifications.getExpoPushTokenAsync({"projectId": Constants.expoConfig.extra.eas.projectId})).data;
|
|
58
59
|
console.log('Notification token',token);
|
|
60
|
+
await Storage.storeData('PUSH_NOTIFICATIONS_ACCEPTED', true);
|
|
61
|
+
await Storage.storeData('PUSH_NOTIFICATIONS_TOKEN', token);
|
|
59
62
|
if(token) {
|
|
60
63
|
await Networking.setToken(token);
|
|
61
64
|
}
|
|
@@ -68,6 +71,13 @@ class NotificationsPush {
|
|
|
68
71
|
|
|
69
72
|
return token;
|
|
70
73
|
}
|
|
74
|
+
|
|
75
|
+
async getPushNotificationsStatus() {
|
|
76
|
+
const { status: existingStatus } = await Notifications.getPermissionsAsync();
|
|
77
|
+
return existingStatus;
|
|
78
|
+
}
|
|
71
79
|
}
|
|
72
80
|
|
|
81
|
+
|
|
82
|
+
|
|
73
83
|
export default new NotificationsPush();
|
package/src/libraries/Rating.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as StoreReview from 'expo-store-review';
|
|
2
2
|
import Storage from './Storage';
|
|
3
3
|
|
|
4
|
-
const REVIEW_INTERVAL = 1000 * 60 * 60 * 24 *
|
|
4
|
+
const REVIEW_INTERVAL = 1000 * 60 * 60 * 24 * 7; // 7 días
|
|
5
5
|
class Rating {
|
|
6
6
|
showRatingDialog = async (force = false) => {
|
|
7
7
|
try {
|
package/types/index.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ declare module 'apps-sdk' {
|
|
|
106
106
|
export class NotificationsPush {
|
|
107
107
|
initialize(): Promise<void>;
|
|
108
108
|
registerForPushNotificationsAsync(): Promise<string>;
|
|
109
|
+
getPushNotificationsStatus(): Promise<string>;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
export interface PayWallProps {
|
|
@@ -150,6 +151,7 @@ declare module 'apps-sdk' {
|
|
|
150
151
|
|
|
151
152
|
export interface AppsSDK {
|
|
152
153
|
initializePushNotifications(): Promise<string>;
|
|
154
|
+
getPushNotificationsStatus(): Promise<string>;
|
|
153
155
|
networking : Networking;
|
|
154
156
|
storage : Storage;
|
|
155
157
|
session : Session;
|
|
@@ -159,6 +161,7 @@ declare module 'apps-sdk' {
|
|
|
159
161
|
adjust : AdJust;
|
|
160
162
|
tracking : TrackingTransparency;
|
|
161
163
|
paywallLogic : PayWallLogic;
|
|
164
|
+
notificationsPush : NotificationsPush;
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
const Core: AppsSDK;
|