mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 22:55:02 +08:00
Merge branch 'master' into dev
This commit is contained in:
commit
dd716aaca7
@ -6,6 +6,7 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports.addAPNSinEntitlements = (entitlementPath, isProduction) => {
|
||||
if( fs.existsSync(entitlementPath) ) {
|
||||
fs.readFile(entitlementPath, "utf8", function(err, data) {
|
||||
if (err) {
|
||||
throw err;
|
||||
@ -41,9 +42,13 @@ module.exports.addAPNSinEntitlements = (entitlementPath, isProduction) => {
|
||||
console.log(entitlementPath + " written successfully");
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log("Entitlement File '" + entitlementPath + "' not found. Make sure your ios platform upper than 4.3.0");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.removeAPNSinEntitlements = (entitlementPath) => {
|
||||
if( fs.existsSync(entitlementPath) ) {
|
||||
fs.readFile(entitlementPath, "utf8", function(err, data) {
|
||||
if (err) {
|
||||
throw err;
|
||||
@ -66,6 +71,9 @@ module.exports.removeAPNSinEntitlements = (entitlementPath) => {
|
||||
console.log(entitlementPath + " written successfully");
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log("Entitlement File '" + entitlementPath + "' not found. Make sure your ios platform upper than 4.3.0");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.getXcodeProjName = (searchPath) => {
|
||||
|
@ -139,6 +139,7 @@ let enablePushNotificationForXCode = (entitlementsPath, pbxprojPath, cordovaBuil
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = (context) => {
|
||||
let basePath = './platforms/ios/';
|
||||
let buildType = 'dev';
|
||||
let xcodeprojName = commonFuncs.getXcodeProjName(basePath);
|
||||
@ -154,7 +155,7 @@ try { // try to read ios developmentTeam from build.json
|
||||
console.log("Do not detected 'build.json' to get ios developent team. \n" +
|
||||
"Will not enable XCode Push Notification Capability. \n" +
|
||||
"Will only enable Push Notification for CI by add config to '" + basePath + xcodeprojName + "/Entitlements-Debug.plist' and '" + basePath + xcodeprojName + "/Entitlements-Release.plist' \n" +
|
||||
"Please add 'build.json' to cordova project root folder to make after hook fullly functional. \n" +
|
||||
"Please add 'build.json' to cordova project root folder to make after hook fully functional. \n" +
|
||||
"Reference [1]https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#cordova-build-command \n" +
|
||||
"Reference [2]https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#signing-an-app");
|
||||
willEnablePushNotificationForXCode = false;
|
||||
@ -165,3 +166,4 @@ enablePushNotificationForCI(basePath, xcodeprojName);
|
||||
if(willEnablePushNotificationForXCode) {
|
||||
enablePushNotificationForXCode(entitlementsPath, pbxprojPath, cordovaBuildConfig);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user