mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-03-16 22:11:04 +08:00
fix #242
This commit is contained in:
parent
e20a10588f
commit
4bc2fe3dc1
@ -6,6 +6,7 @@ const fs = require('fs');
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports.addAPNSinEntitlements = (entitlementPath, isProduction) => {
|
module.exports.addAPNSinEntitlements = (entitlementPath, isProduction) => {
|
||||||
|
if( fs.existsSync(entitlementPath) ) {
|
||||||
fs.readFile(entitlementPath, "utf8", function(err, data) {
|
fs.readFile(entitlementPath, "utf8", function(err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
@ -41,9 +42,13 @@ module.exports.addAPNSinEntitlements = (entitlementPath, isProduction) => {
|
|||||||
console.log(entitlementPath + " written successfully");
|
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) => {
|
module.exports.removeAPNSinEntitlements = (entitlementPath) => {
|
||||||
|
if( fs.existsSync(entitlementPath) ) {
|
||||||
fs.readFile(entitlementPath, "utf8", function(err, data) {
|
fs.readFile(entitlementPath, "utf8", function(err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
throw err;
|
throw err;
|
||||||
@ -66,6 +71,9 @@ module.exports.removeAPNSinEntitlements = (entitlementPath) => {
|
|||||||
console.log(entitlementPath + " written successfully");
|
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) => {
|
module.exports.getXcodeProjName = (searchPath) => {
|
||||||
|
@ -139,6 +139,7 @@ let enablePushNotificationForXCode = (entitlementsPath, pbxprojPath, cordovaBuil
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = (context) => {
|
||||||
let basePath = './platforms/ios/';
|
let basePath = './platforms/ios/';
|
||||||
let buildType = 'dev';
|
let buildType = 'dev';
|
||||||
let xcodeprojName = commonFuncs.getXcodeProjName(basePath);
|
let xcodeprojName = commonFuncs.getXcodeProjName(basePath);
|
||||||
@ -165,3 +166,4 @@ enablePushNotificationForCI(basePath, xcodeprojName);
|
|||||||
if(willEnablePushNotificationForXCode) {
|
if(willEnablePushNotificationForXCode) {
|
||||||
enablePushNotificationForXCode(entitlementsPath, pbxprojPath, cordovaBuildConfig);
|
enablePushNotificationForXCode(entitlementsPath, pbxprojPath, cordovaBuildConfig);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user