onesignal-expo-plugin 2.3.0 → 2.5.0
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/README.md +66 -14
- package/dist/index.d.ts +101 -0
- package/dist/index.js +711 -0
- package/package.json +43 -45
- package/serviceExtensionFiles/NotificationService.swift +32 -0
- package/{build/support/serviceExtensionFiles → serviceExtensionFiles}/OneSignalNotificationServiceExtension-Info.plist +1 -1
- package/widgetExtensionFiles/OneSignalWidget-Info.plist +29 -0
- package/widgetExtensionFiles/OneSignalWidgetBundle.swift +9 -0
- package/widgetExtensionFiles/OneSignalWidgetLiveActivity.swift +58 -0
- package/app.plugin.js +0 -1
- package/build/onesignal/withOneSignal.d.ts +0 -8
- package/build/onesignal/withOneSignal.js +0 -20
- package/build/onesignal/withOneSignalAndroid.d.ts +0 -7
- package/build/onesignal/withOneSignalAndroid.js +0 -126
- package/build/onesignal/withOneSignalIos.d.ts +0 -7
- package/build/onesignal/withOneSignalIos.js +0 -238
- package/build/support/FileManager.d.ts +0 -9
- package/build/support/FileManager.js +0 -75
- package/build/support/NseUpdaterManager.d.ts +0 -8
- package/build/support/NseUpdaterManager.js +0 -38
- package/build/support/OneSignalLog.d.ts +0 -4
- package/build/support/OneSignalLog.js +0 -12
- package/build/support/eas/getEasManagedCredentialsConfigExtra.d.ts +0 -4
- package/build/support/eas/getEasManagedCredentialsConfigExtra.js +0 -36
- package/build/support/helpers.d.ts +0 -2
- package/build/support/helpers.js +0 -51
- package/build/support/iosConstants.d.ts +0 -12
- package/build/support/iosConstants.js +0 -23
- package/build/support/serviceExtensionFiles/NotificationService.m +0 -34
- package/build/support/updatePodfile.d.ts +0 -1
- package/build/support/updatePodfile.js +0 -20
- package/build/types/types.d.ts +0 -55
- package/build/types/types.js +0 -15
- /package/{build/support/serviceExtensionFiles → serviceExtensionFiles}/NotificationService.h +0 -0
- /package/{build/support/serviceExtensionFiles → serviceExtensionFiles}/OneSignalNotificationServiceExtension.entitlements +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FileManager contains static *awaitable* file-system functions
|
|
3
|
-
*/
|
|
4
|
-
export declare class FileManager {
|
|
5
|
-
static readFile(path: string): Promise<string>;
|
|
6
|
-
static writeFile(path: string, contents: string): Promise<void>;
|
|
7
|
-
static copyFile(path1: string, path2: string): Promise<void>;
|
|
8
|
-
static dirExists(path: string): boolean;
|
|
9
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.FileManager = void 0;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const OneSignalLog_1 = require("./OneSignalLog");
|
|
39
|
-
/**
|
|
40
|
-
* FileManager contains static *awaitable* file-system functions
|
|
41
|
-
*/
|
|
42
|
-
class FileManager {
|
|
43
|
-
static async readFile(path) {
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
fs.readFile(path, 'utf8', (err, data) => {
|
|
46
|
-
if (err || !data) {
|
|
47
|
-
OneSignalLog_1.OneSignalLog.error("Couldn't read file:" + path);
|
|
48
|
-
reject(err);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
resolve(data);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
static async writeFile(path, contents) {
|
|
56
|
-
return new Promise((resolve, reject) => {
|
|
57
|
-
fs.writeFile(path, contents, 'utf8', (err) => {
|
|
58
|
-
if (err) {
|
|
59
|
-
OneSignalLog_1.OneSignalLog.error("Couldn't write file:" + path);
|
|
60
|
-
reject(err);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
resolve();
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
static async copyFile(path1, path2) {
|
|
68
|
-
const fileContents = await FileManager.readFile(path1);
|
|
69
|
-
await FileManager.writeFile(path2, fileContents);
|
|
70
|
-
}
|
|
71
|
-
static dirExists(path) {
|
|
72
|
-
return fs.existsSync(path);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.FileManager = FileManager;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export default class NseUpdaterManager {
|
|
2
|
-
private nsePath;
|
|
3
|
-
constructor(iosPath: string);
|
|
4
|
-
updateNSEEntitlements(groupIdentifier: string): Promise<void>;
|
|
5
|
-
updateNSEBundleVersion(version: string): Promise<void>;
|
|
6
|
-
updateNSEBundleShortVersion(version: string): Promise<void>;
|
|
7
|
-
updateNSEInfoPlistAppGroupKey(appGroupName: string): Promise<void>;
|
|
8
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const FileManager_1 = require("./FileManager");
|
|
4
|
-
const iosConstants_1 = require("./iosConstants");
|
|
5
|
-
const entitlementsFileName = `${iosConstants_1.NSE_TARGET_NAME}.entitlements`;
|
|
6
|
-
const plistFileName = `${iosConstants_1.NSE_TARGET_NAME}-Info.plist`;
|
|
7
|
-
class NseUpdaterManager {
|
|
8
|
-
nsePath;
|
|
9
|
-
constructor(iosPath) {
|
|
10
|
-
this.nsePath = `${iosPath}/${iosConstants_1.NSE_TARGET_NAME}`;
|
|
11
|
-
}
|
|
12
|
-
async updateNSEEntitlements(groupIdentifier) {
|
|
13
|
-
const entitlementsFilePath = `${this.nsePath}/${entitlementsFileName}`;
|
|
14
|
-
let entitlementsFile = await FileManager_1.FileManager.readFile(entitlementsFilePath);
|
|
15
|
-
entitlementsFile = entitlementsFile.replace(iosConstants_1.GROUP_IDENTIFIER_TEMPLATE_REGEX, groupIdentifier);
|
|
16
|
-
await FileManager_1.FileManager.writeFile(entitlementsFilePath, entitlementsFile);
|
|
17
|
-
}
|
|
18
|
-
async updateNSEBundleVersion(version) {
|
|
19
|
-
const plistFilePath = `${this.nsePath}/${plistFileName}`;
|
|
20
|
-
let plistFile = await FileManager_1.FileManager.readFile(plistFilePath);
|
|
21
|
-
plistFile = plistFile.replace(iosConstants_1.BUNDLE_VERSION_TEMPLATE_REGEX, version);
|
|
22
|
-
await FileManager_1.FileManager.writeFile(plistFilePath, plistFile);
|
|
23
|
-
}
|
|
24
|
-
async updateNSEBundleShortVersion(version) {
|
|
25
|
-
const plistFilePath = `${this.nsePath}/${plistFileName}`;
|
|
26
|
-
let plistFile = await FileManager_1.FileManager.readFile(plistFilePath);
|
|
27
|
-
plistFile = plistFile.replace(iosConstants_1.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX, version);
|
|
28
|
-
await FileManager_1.FileManager.writeFile(plistFilePath, plistFile);
|
|
29
|
-
}
|
|
30
|
-
async updateNSEInfoPlistAppGroupKey(appGroupName) {
|
|
31
|
-
const plistFilePath = `${this.nsePath}/${plistFileName}`;
|
|
32
|
-
let plistFile = await FileManager_1.FileManager.readFile(plistFilePath);
|
|
33
|
-
const appGroupEntry = `\t<key>OneSignal_app_groups_key</key>\n\t<string>${appGroupName}</string>\n</dict>\n</plist>`;
|
|
34
|
-
plistFile = plistFile.replace('</dict>\n</plist>', appGroupEntry);
|
|
35
|
-
await FileManager_1.FileManager.writeFile(plistFilePath, plistFile);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.default = NseUpdaterManager;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OneSignalLog = void 0;
|
|
4
|
-
class OneSignalLog {
|
|
5
|
-
static log(str) {
|
|
6
|
-
console.log(`\tonesignal-expo-plugin: ${str}`);
|
|
7
|
-
}
|
|
8
|
-
static error(str) {
|
|
9
|
-
console.error(`\tonesignal-expo-plugin: ${str}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.OneSignalLog = OneSignalLog;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = getEasManagedCredentialsConfigExtra;
|
|
4
|
-
const iosConstants_1 = require("../iosConstants");
|
|
5
|
-
const helpers_1 = require("../helpers");
|
|
6
|
-
function getEasManagedCredentialsConfigExtra(config, appGroupName, nseBundleIdentifier) {
|
|
7
|
-
const bundleId = `${config?.ios?.bundleIdentifier}.${nseBundleIdentifier ?? iosConstants_1.NSE_TARGET_NAME}`;
|
|
8
|
-
return {
|
|
9
|
-
...config.extra,
|
|
10
|
-
eas: {
|
|
11
|
-
...config.extra?.eas,
|
|
12
|
-
build: {
|
|
13
|
-
...config.extra?.eas?.build,
|
|
14
|
-
experimental: {
|
|
15
|
-
...config.extra?.eas?.build?.experimental,
|
|
16
|
-
ios: {
|
|
17
|
-
...config.extra?.eas?.build?.experimental?.ios,
|
|
18
|
-
appExtensions: [
|
|
19
|
-
...(config.extra?.eas?.build?.experimental?.ios?.appExtensions ??
|
|
20
|
-
[]),
|
|
21
|
-
{
|
|
22
|
-
targetName: iosConstants_1.NSE_TARGET_NAME,
|
|
23
|
-
bundleIdentifier: bundleId,
|
|
24
|
-
entitlements: {
|
|
25
|
-
'com.apple.security.application-groups': [
|
|
26
|
-
(0, helpers_1.getAppGroupIdentifier)(config?.ios?.bundleIdentifier ?? '', appGroupName),
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
package/build/support/helpers.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validatePluginProps = validatePluginProps;
|
|
4
|
-
exports.getAppGroupIdentifier = getAppGroupIdentifier;
|
|
5
|
-
const types_1 = require("../types/types");
|
|
6
|
-
function validatePluginProps(props) {
|
|
7
|
-
// check the type of each property
|
|
8
|
-
if (typeof props.mode !== 'string') {
|
|
9
|
-
throw new Error("OneSignal Expo Plugin: 'mode' must be a string.");
|
|
10
|
-
}
|
|
11
|
-
if (props.devTeam && typeof props.devTeam !== 'string') {
|
|
12
|
-
throw new Error("OneSignal Expo Plugin: 'devTeam' must be a string.");
|
|
13
|
-
}
|
|
14
|
-
if (props.iPhoneDeploymentTarget &&
|
|
15
|
-
typeof props.iPhoneDeploymentTarget !== 'string') {
|
|
16
|
-
throw new Error("OneSignal Expo Plugin: 'iPhoneDeploymentTarget' must be a string.");
|
|
17
|
-
}
|
|
18
|
-
if (props.smallIcons && !Array.isArray(props.smallIcons)) {
|
|
19
|
-
throw new Error("OneSignal Expo Plugin: 'smallIcons' must be an array.");
|
|
20
|
-
}
|
|
21
|
-
if (props.smallIconAccentColor &&
|
|
22
|
-
typeof props.smallIconAccentColor !== 'string') {
|
|
23
|
-
throw new Error("OneSignal Expo Plugin: 'smallIconAccentColor' must be a string.");
|
|
24
|
-
}
|
|
25
|
-
if (props.largeIcons && !Array.isArray(props.largeIcons)) {
|
|
26
|
-
throw new Error("OneSignal Expo Plugin: 'largeIcons' must be an array.");
|
|
27
|
-
}
|
|
28
|
-
if (props.iosNSEFilePath && typeof props.iosNSEFilePath !== 'string') {
|
|
29
|
-
throw new Error("OneSignal Expo Plugin: 'iosNSEFilePath' must be a string.");
|
|
30
|
-
}
|
|
31
|
-
if (props.appGroupName && typeof props.appGroupName !== 'string') {
|
|
32
|
-
throw new Error("OneSignal Expo Plugin: 'appGroupName' must be a string.");
|
|
33
|
-
}
|
|
34
|
-
if (props.nseBundleIdentifier &&
|
|
35
|
-
typeof props.nseBundleIdentifier !== 'string') {
|
|
36
|
-
throw new Error("OneSignal Expo Plugin: 'nseBundleIdentifier' must be a string.");
|
|
37
|
-
}
|
|
38
|
-
if (props.disableNSE !== undefined && typeof props.disableNSE !== 'boolean') {
|
|
39
|
-
throw new Error("OneSignal Expo Plugin: 'disableNSE' must be a boolean.");
|
|
40
|
-
}
|
|
41
|
-
// check for extra properties
|
|
42
|
-
const inputProps = Object.keys(props);
|
|
43
|
-
for (const prop of inputProps) {
|
|
44
|
-
if (!types_1.ONESIGNAL_PLUGIN_PROPS.includes(prop)) {
|
|
45
|
-
throw new Error(`OneSignal Expo Plugin: You have provided an invalid property "${prop}" to the OneSignal plugin.`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function getAppGroupIdentifier(bundleIdentifier, customAppGroupName) {
|
|
50
|
-
return customAppGroupName ?? `group.${bundleIdentifier}.onesignal`;
|
|
51
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const IPHONEOS_DEPLOYMENT_TARGET = "11.0";
|
|
2
|
-
export declare const TARGETED_DEVICE_FAMILY = "\"1,2\"";
|
|
3
|
-
export declare const GROUP_IDENTIFIER_TEMPLATE_REGEX: RegExp;
|
|
4
|
-
export declare const BUNDLE_SHORT_VERSION_TEMPLATE_REGEX: RegExp;
|
|
5
|
-
export declare const BUNDLE_VERSION_TEMPLATE_REGEX: RegExp;
|
|
6
|
-
export declare const DEFAULT_BUNDLE_VERSION = "1";
|
|
7
|
-
export declare const DEFAULT_BUNDLE_SHORT_VERSION = "1.0";
|
|
8
|
-
export declare const NSE_TARGET_NAME = "OneSignalNotificationServiceExtension";
|
|
9
|
-
export declare const NSE_SOURCE_FILE = "NotificationService.m";
|
|
10
|
-
export declare const NSE_PODFILE_SNIPPET = "\ntarget 'OneSignalNotificationServiceExtension' do\n pod 'OneSignalXCFramework', '>= 5.0', '< 6.0'\n use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']\nend";
|
|
11
|
-
export declare const NSE_PODFILE_REGEX: RegExp;
|
|
12
|
-
export declare const NSE_EXT_FILES: string[];
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NSE_EXT_FILES = exports.NSE_PODFILE_REGEX = exports.NSE_PODFILE_SNIPPET = exports.NSE_SOURCE_FILE = exports.NSE_TARGET_NAME = exports.DEFAULT_BUNDLE_SHORT_VERSION = exports.DEFAULT_BUNDLE_VERSION = exports.BUNDLE_VERSION_TEMPLATE_REGEX = exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = exports.TARGETED_DEVICE_FAMILY = exports.IPHONEOS_DEPLOYMENT_TARGET = void 0;
|
|
4
|
-
exports.IPHONEOS_DEPLOYMENT_TARGET = '11.0';
|
|
5
|
-
exports.TARGETED_DEVICE_FAMILY = `"1,2"`;
|
|
6
|
-
exports.GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm;
|
|
7
|
-
exports.BUNDLE_SHORT_VERSION_TEMPLATE_REGEX = /{{BUNDLE_SHORT_VERSION}}/gm;
|
|
8
|
-
exports.BUNDLE_VERSION_TEMPLATE_REGEX = /{{BUNDLE_VERSION}}/gm;
|
|
9
|
-
exports.DEFAULT_BUNDLE_VERSION = '1';
|
|
10
|
-
exports.DEFAULT_BUNDLE_SHORT_VERSION = '1.0';
|
|
11
|
-
exports.NSE_TARGET_NAME = 'OneSignalNotificationServiceExtension';
|
|
12
|
-
exports.NSE_SOURCE_FILE = 'NotificationService.m';
|
|
13
|
-
exports.NSE_PODFILE_SNIPPET = `
|
|
14
|
-
target '${exports.NSE_TARGET_NAME}' do
|
|
15
|
-
pod 'OneSignalXCFramework', '>= 5.0', '< 6.0'
|
|
16
|
-
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
|
|
17
|
-
end`;
|
|
18
|
-
exports.NSE_PODFILE_REGEX = new RegExp(`target '${exports.NSE_TARGET_NAME}'`);
|
|
19
|
-
exports.NSE_EXT_FILES = [
|
|
20
|
-
'NotificationService.h',
|
|
21
|
-
`${exports.NSE_TARGET_NAME}.entitlements`,
|
|
22
|
-
`${exports.NSE_TARGET_NAME}-Info.plist`,
|
|
23
|
-
];
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#import <OneSignalFramework/OneSignalFramework.h>
|
|
2
|
-
|
|
3
|
-
#import "NotificationService.h"
|
|
4
|
-
|
|
5
|
-
@interface NotificationService ()
|
|
6
|
-
|
|
7
|
-
@property(nonatomic, strong) void (^contentHandler)
|
|
8
|
-
(UNNotificationContent *contentToDeliver);
|
|
9
|
-
@property(nonatomic, strong) UNNotificationRequest *receivedRequest;
|
|
10
|
-
@property(nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
|
|
11
|
-
|
|
12
|
-
@end
|
|
13
|
-
|
|
14
|
-
@implementation NotificationService
|
|
15
|
-
|
|
16
|
-
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request
|
|
17
|
-
withContentHandler:
|
|
18
|
-
(void (^)(UNNotificationContent *_Nonnull))
|
|
19
|
-
contentHandler {
|
|
20
|
-
self.receivedRequest = request;
|
|
21
|
-
self.contentHandler = contentHandler;
|
|
22
|
-
self.bestAttemptContent = [request.content mutableCopy];
|
|
23
|
-
[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest
|
|
24
|
-
withMutableNotificationContent:self.bestAttemptContent
|
|
25
|
-
withContentHandler:self.contentHandler];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
- (void)serviceExtensionTimeWillExpire {
|
|
29
|
-
[OneSignal serviceExtensionTimeWillExpireRequest:self.receivedRequest
|
|
30
|
-
withMutableNotificationContent:self.bestAttemptContent];
|
|
31
|
-
self.contentHandler(self.bestAttemptContent);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function updatePodfile(iosPath: string): Promise<void>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updatePodfile = updatePodfile;
|
|
7
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
-
const iosConstants_1 = require("./iosConstants");
|
|
9
|
-
const OneSignalLog_1 = require("./OneSignalLog");
|
|
10
|
-
const FileManager_1 = require("./FileManager");
|
|
11
|
-
async function updatePodfile(iosPath) {
|
|
12
|
-
const podfile = await FileManager_1.FileManager.readFile(`${iosPath}/Podfile`);
|
|
13
|
-
const matches = podfile.match(iosConstants_1.NSE_PODFILE_REGEX);
|
|
14
|
-
if (matches) {
|
|
15
|
-
OneSignalLog_1.OneSignalLog.log(`${iosConstants_1.NSE_TARGET_NAME} target already added to Podfile. Skipping...`);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
await promises_1.default.appendFile(`${iosPath}/Podfile`, iosConstants_1.NSE_PODFILE_SNIPPET);
|
|
19
|
-
OneSignalLog_1.OneSignalLog.log(`${iosConstants_1.NSE_TARGET_NAME} target added to Podfile.`);
|
|
20
|
-
}
|
package/build/types/types.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OneSignalPluginProps refer to the properties set by the user in their app config file (e.g: app.json)
|
|
3
|
-
*/
|
|
4
|
-
export type OneSignalPluginProps = {
|
|
5
|
-
/**
|
|
6
|
-
* (required) Used to configure APNs environment entitlement. "development" or "production"
|
|
7
|
-
*/
|
|
8
|
-
mode: 'development' | 'production';
|
|
9
|
-
/**
|
|
10
|
-
* (optional) Used to configure Apple Team ID. You can find your Apple Team ID by running expo credentials:manager e.g: "91SW8A37CR"
|
|
11
|
-
*/
|
|
12
|
-
devTeam?: string;
|
|
13
|
-
/**
|
|
14
|
-
* (optional) Target IPHONEOS_DEPLOYMENT_TARGET value to be used when adding the iOS NSE. A deployment target is nothing more than
|
|
15
|
-
* the minimum version of the operating system the application can run on. This value should match the value in your Podfile e.g: "12.0".
|
|
16
|
-
*/
|
|
17
|
-
iPhoneDeploymentTarget?: string;
|
|
18
|
-
/**
|
|
19
|
-
* (optional) The small notification icons for Android. Images will be automatically scaled up/down, the recommended size
|
|
20
|
-
* is 96x96 to always scale down.
|
|
21
|
-
*/
|
|
22
|
-
smallIcons?: string[];
|
|
23
|
-
/**
|
|
24
|
-
* (optional) The accent color to use for notification icons on Android. Must be a valid Android color resource, for example: "#FF0000"
|
|
25
|
-
*/
|
|
26
|
-
smallIconAccentColor?: string;
|
|
27
|
-
/**
|
|
28
|
-
* (optional) The large notification icons for Android. Images will be automatically scaled up/down to 256x256.
|
|
29
|
-
*/
|
|
30
|
-
largeIcons?: string[];
|
|
31
|
-
/**
|
|
32
|
-
* (optional) The local path to a custom Notification Service Extension (NSE), written in Objective-C. The NSE will typically start as a copy
|
|
33
|
-
* of the default NSE found at (support/serviceExtensionFiles/NotificationService.m, then altered to support any custom
|
|
34
|
-
* logic required.
|
|
35
|
-
*/
|
|
36
|
-
iosNSEFilePath?: string;
|
|
37
|
-
/**
|
|
38
|
-
* (optional) Used to configure a custom iOS app group name. If not provided, defaults to "group.{ios.bundleIdentifier}.onesignal".
|
|
39
|
-
* @see https://documentation.onesignal.com/docs/ios-sdk-setup#step-3-create-an-app-group
|
|
40
|
-
*/
|
|
41
|
-
appGroupName?: string;
|
|
42
|
-
/**
|
|
43
|
-
* (optional) Used to configure a custom bundle identifier suffix for the iOS Notification Service Extension.
|
|
44
|
-
* The full bundle identifier will be "{ios.bundleIdentifier}.{nseBundleIdentifier}".
|
|
45
|
-
* If not provided, defaults to "OneSignalNotificationServiceExtension".
|
|
46
|
-
*/
|
|
47
|
-
nseBundleIdentifier?: string;
|
|
48
|
-
/**
|
|
49
|
-
* (optional) If true, the iOS Notification Service Extension (NSE) will not be added to the project.
|
|
50
|
-
* The NSE is required for badges, confirmed delivery, media attachments, and action buttons.
|
|
51
|
-
* Only disable if you only need basic push notifications.
|
|
52
|
-
*/
|
|
53
|
-
disableNSE?: boolean;
|
|
54
|
-
};
|
|
55
|
-
export declare const ONESIGNAL_PLUGIN_PROPS: string[];
|
package/build/types/types.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ONESIGNAL_PLUGIN_PROPS = void 0;
|
|
4
|
-
exports.ONESIGNAL_PLUGIN_PROPS = [
|
|
5
|
-
'mode',
|
|
6
|
-
'devTeam',
|
|
7
|
-
'iPhoneDeploymentTarget',
|
|
8
|
-
'smallIcons',
|
|
9
|
-
'largeIcons',
|
|
10
|
-
'iosNSEFilePath',
|
|
11
|
-
'smallIconAccentColor',
|
|
12
|
-
'appGroupName',
|
|
13
|
-
'nseBundleIdentifier',
|
|
14
|
-
'disableNSE',
|
|
15
|
-
];
|
/package/{build/support/serviceExtensionFiles → serviceExtensionFiles}/NotificationService.h
RENAMED
|
File without changes
|