Monetary

Monetary MobileToken iOS Framework

Getting started with iOS MobileToken

Add MonetaryMobileToken.framework to your Xcode project

  1. In the project navigator, select the project or group within a project to which you want to add the framework.
  2. Choose File > Add Files to “Your Project Name”.
  3. Select the MonetaryMobileToken.framework bundle, and click Add.
  4. In the project settings, choose the Build Phases tab.
  5. Under the Embed Frameworks section, choose "+" to add a new Embedded Framework.
  6. Select the MonetaryMobileToken.framework bundle, and click Add.

Include the framework in your code

#import <MonetaryMobileToken/MonetaryMobileToken.h>

Implement the tokenization delegate

Implement the MonetaryTokenDelegate protocol
@interface ViewController : UIViewController <MonetaryTokenDelegate>
Implement MonetaryTokenDelegate methods
On Loading:
- (void)tokenLoading
{
  // The framework has begun tokenizing user-input account data.
}
On Success:
- (void)tokenCreated:(MonetaryToken *)token
{
  // A token has been received!
}

In the tokenCreated method, the received MonetaryToken object contains 5 NSString properties:

On Error:
- (void)tokenizationError:(NSError *)error
{
  // A tokenization error has occurred!
}

The tokenizationError method will receive an NSError object with one of the 4 following error codes:

On Cancel:
- (void)tokenizationCancelled
{
  // The user has cancelled tokenization!
}

Request a token for keyed account

Provide a MonetaryTokenizer object with a Monetary public key, a MonetaryTokenDelegate object which to send events, and a UIViewController over which to display the account entry views
MonetaryTokenizer *tokenizer = [MonetaryTokenizer new];
[tokenizer requestKeyedTokenWithPublicKey:@"[Public Key Goes Here]"
                              andDelegate:self
                       overViewController:self];

Report bugs

If you encounter any bugs or issues with the latest version of MobileToken for iOS, please report them to us by opening a GitHub Issue!