This is Phunware's Core SDK for use with its Multiscreen-as-a-Service platform. Visit http://maas.phunware.com for more details and to sign up.
NOTE: This is a required dependency for all Phunware SDKs.
- iOS 15.5 or greater
- Xcode 15 or greater
It is required to use CocoaPods 1.12 or greater to integrate the framework. Simply add the following to your Podfile:
pod 'PWCore'
To enable support for requesting authorization to access the identifier for advertisers (IDFA), add the DeviceIdentity
subspec:
pod 'PWCore/DeviceIdentity'
Documentation is included in the Documents folder in the repository as both HTML and as a .docset. You can also find the latest documentation here: http://phunware.github.io/maas-core-ios-sdk
Import PWCore at the top of your application's delegate:
import PWCore
Initialize PWCore in your application delegate's application(_:didFinishLaunchingWithOptions:) method:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// These values can be found for your application in the MaaS portal at http://maas.phunware.com/clients.
PWCore.setApplicationID("APPLICATION_ID",
accessKey: "ACCESS_KEY")
...
}
Location authorization of "When In Use" or "Always" is encouraged when starting PWCore for analytics purposes. Please follow Apple's Best Practices for requesting location permissions.
Starting with iOS 14.5, accessing the identifier for advertisers (IDFA) requires authorization through Apple's AppTrackingTransparency framework. Authorization is encouraged when starting PWCore, and can be requested directly through the SDK:
import PWCore
import DeviceIdentity
...
switch PWCore.isAdvertisingIdentifierPermissionRequestable {
case .allowed:
PWCore.requestAdvertisingIdentifierPermission { (advertisingIdentifier) in
// Advertising identifier available
print("Advertising Identifier: \(advertisingIdentifier)")
} failure: { (error) in
// Advertising identifier not available
print(error)
}
case .notAllowed:
// Authorization is either restricted or has been previously denied
print("Advertising identifier cannot be requested.")
case .alreadyAuthorized:
// Advertising identifier is already available
print("Advertising Identifier: \(PWCore.deviceID())")
}
PWCore uses the following third-party dependencies:
Component | Description | License |
---|---|---|
PINCache | Fast, non-deadlocking parallel object cache for iOS, tvOS and OS X. | Apache 2.0 |
SSZipArchive | Zipping and unzipping files for iOS and OS X. | MIT |
You understand and consent to Phunware’s Privacy Policy located at www.phunware.com/privacy. If your use of Phunware’s software requires a Privacy Policy of your own, you also agree to include the terms of Phunware’s Privacy Policy in your Privacy Policy to your end users.
Use of this software requires review and acceptance of our terms and conditions for developer use located at http://www.phunware.com/terms