How to use the ioslib.provisioning function in ioslib

To help you get started, we’ve selected a few ioslib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appcelerator / tio2 / lib / suite.js View on Github external
ioslib.certs.detect(function (err, certResults) {
					var certs = [];
					Object.keys(certResults.certs.keychains).forEach(function (keychain) {
						var types = certResults.certs.keychains[keychain];
						Object.keys(types).forEach(function (type) {
							certs = certs.concat(types[type]);
						});
					});

					if (!certs.length) {
						return cb(new Error('No iOS certificates'));
					}

					// find us a provisioning profile
					ioslib.provisioning.find({
						appId: self.tiapp.id,
						certs: certs,
						devicesUDIDs: deviceResults.devices.map(function (device) { return device.udid; })
					}, function (err, profiles) {
						if (err || !profiles.length) {
							return cb(new Error('No provisioning profiles found'));
						}

						var profile = profiles.shift(),
							deviceUDID = deviceResults.devices.filter(function (device) { return profile.devices.indexOf(device.udid) !== -1; }).shift().udid,
							certName = certs.filter(function (cert) {
								var prefix = cert.pem.replace(/^-----BEGIN CERTIFICATE-----\n/, '').substring(0, 60);
								return profile.certs.some(function (pc) {
									return pc.indexOf(prefix) === 0;
								});
							}).shift().name;

ioslib

iOS Utility Library

Apache-2.0
Latest version published 7 months ago

Package Health Score

61 / 100
Full package analysis