PWCore Class Reference

Inherits from NSObject
Declared in PWCore.h

Required Methods

+ setApplicationID:accessKey:signatureKey:

Initializes PWCore and all associated MaaS modules. This method should be called inside application:didFinishLaunchingWithOptions: before you do anything else.

+ (void)setApplicationID:(NSString *)applicationID accessKey:(NSString *)accessKey signatureKey:(NSString *)signatureKey

Parameters

applicationID

You can find your Application ID in the MaaS portal.

accessKey

A unique key that identifies the client making the request. You can find your Access Key in the MaaS portal.

signatureKey

A unique key that is used to sign requests. The signature is used to both check request authorization as well as data integrity. You can find your Signature Key in the MaaS portal.

Declared In

PWCore.h

+ setApplicationID:accessKey:signatureKey:encryptionKey:

This method has been deprecated. Use setApplicationID:accessKey:signatureKey: instead.

+ (void)setApplicationID:(NSString *)applicationID accessKey:(NSString *)accessKey signatureKey:(NSString *)signatureKey encryptionKey:(NSString *)encryptionKey

Parameters

applicationID

You can find your Application ID in the MaaS portal.

accessKey

A unique key that identifies the client making the request. You can find your Access Key in the MaaS portal.

signatureKey

A unique key that is used to sign requests. The signature is used to both check request authorization as well as data integrity. You can find your Signature Key in the MaaS portal.

encryptionKey

A unique encryption key this is no longer required. set empty string.

Declared In

PWCore.h

+ applicationID

Returns the MaaS Application ID.

+ (NSString *)applicationID

Declared In

PWCore.h

+ deviceID

Returns the Device ID.

+ (NSString *)deviceID

Declared In

PWCore.h

+ serviceName

Returns ‘PWCore’.

+ (NSString *)serviceName

Declared In

PWCore.h

+ registerModule:version:withCompletion:

This method registers the module and its version.

+ (void)registerModule:(NSString *)moduleName version:(NSString *)version withCompletion:(void ( ^ ) ( NSError *error ))completion

Parameters

moduleName

The name of the dependent module to be registered.

version

version number for the module

completion

The completion block to be called.

Declared In

PWCore.h

+ getAllRegisteredModules

Returns a dictionary of registered modules.

+ (NSDictionary *)getAllRegisteredModules

Declared In

PWCore.h

+ getVersionForModule:

Returns version number for a registered module.

+ (NSString *)getVersionForModule:(NSString *)moduleName

Parameters

moduleName

The name of the dependent module to be registered.

Declared In

PWCore.h

+ enableLocationAccess:

Determines whether location updates are permitted.

+ (void)enableLocationAccess:(BOOL)enable

Parameters

enable

Will permit location updates and include location information in analytic events. Default is enabled.

Declared In

PWCore.h

+ isLocationAccessEnabled

Returns whether location updates are permitted.

+ (BOOL)isLocationAccessEnabled

Declared In

PWCore.h

+ sessionID

+ (NSString *__nonnull)sessionID

+ getEnvironment

+ (PWEnvironment)getEnvironment

+ setEnvironment:

+ (void)setEnvironment:(PWEnvironment)environment

+ setAnalyticsApplicationID:accessKey:signatureKey:

+ (void)setAnalyticsApplicationID:(NSString *)applicationID accessKey:(NSString *)accessKey signatureKey:(NSString *)signatureKey

+ setAnalyticsEnvironment:

+ (void)setAnalyticsEnvironment:(PWEnvironment)environment

+ accessKey

+ (NSString *__nullable)accessKey

+ server

+ (NSString *_Nullable)server

+ authorizationHeaderWithRequestBody:httpMethod:

+ (NSString *__nonnull)authorizationHeaderWithRequestBody:(NSData *__nonnull)requestBody httpMethod:(NSString *__nonnull)httpMethod

+ buildRequestWithRequest:

+ (NSMutableURLRequest *__nonnull)buildRequestWithRequest:(NSMutableURLRequest *__nonnull)request

+ standardAnalyticsPayload

+ (NSMutableDictionary *__nonnull)standardAnalyticsPayload

+ sendInternalAnalyticsPayload:completion:

+ (void)sendInternalAnalyticsPayload:(NSDictionary *__nonnull)payload completion:(void ( ^ __nullable ) ( NSError *__nullable error ))completion

+ sendExtraAnalyticsPayload:completion:

+ (void)sendExtraAnalyticsPayload:(NSDictionary *__nonnull)payload completion:(void ( ^ __nullable ) ( NSError *__nullable error ))completion

+ registerPhunwareModule:version:withCompletion:

+ (void)registerPhunwareModule:(NSString *__nonnull)moduleName version:(NSString *__nonnull)version withCompletion:(void ( ^ __nullable ) ( NSError *__nullable error ))completion

+ encryptData:withKey:

+ (NSData *_Nullable)encryptData:(NSData *__nonnull)data withKey:(NSString *__nonnull)key

+ decryptData:withKey:

+ (NSData *_Nullable)decryptData:(NSData *__nonnull)data withKey:(NSString *__nonnull)key