Conforms to NSObject
Declared in PRXAuthentication.h

Overview

The PRXAuthenticationManager protocol is adopted by the shared authentication manager.

Instance Methods

authenticateWithAppName:success:failure:

Authenticates an application with TapPoint.

- (void)authenticateWithAppName:(NSString *)appName success:(PRXAuthenticateSuccessBlock)successBlock failure:(PRXAuthenticateFailureBlock)failureBlock

Parameters

appName

Name of the application on TapPoint. This can be found in your app’s settings on TapPoint’s campaign portal. This is case sensitive.

successBlock

Block called when authentication succeeds. You should use this block to perform additional steps that depend on successful authentication, such as synchronising with TapPoint.

failureBlock

Block called when authentication fails. This block contains an NSError argument describing the cause of the error.

Discussion

You must wait for this method to call its success block before attempting to use any TapPoint features. You should typically call this method as soon as possible after application launch, or when the network connection first becomes available. You should call this method every time the application launches, even if the application has been successfully authenticated on a previous launch.

Authentication can fail for several reasons, for example the provided application name is invalid, or if the network connection is not functioning. Your application should inspect the NSError object that is returned in the failure block of this method and decide whether it is possible to recover. This might mean listening for when the network connection status changes so that the application can attempt to register again.

Declared In

PRXAuthentication.h