Switch to dark theme

Switch to light theme

Adding the SDK to your App


Please follow the steps below to successfully complete this step

1. Adding the SDK

The iOS Card SDK is compatible with apps supporting iOS with version 10 and above. To add the SDK to your project, follow these steps :

  1. Download and extract the zip folder containing an XCFramework for Card SDK from here.

  2. Drag & drop the framework file you just downloaded into your projects target

  3. Click Embed & sign under the XCFramework in your project’s target. Set Allow Non-modular Includes in Framework Modules to YES underTarget > Build Settings. Set Enable Bitcode to NO underTarget > Build Settings.

2. Setting up the SDK

  1. Adding configuration files A configuration file contains all the properties necessary for activating the SDK. You should add the file to the main target of your project to prepare your app to work with the SDK. You will receive the configuration file named supercardSdk.plist through email. If you haven’t received the file, contact Zeta Support.

  2. Adding theme & template files Card SDK provides you with the capability to define the theme and layout used by the SDK. These can be edited remotely so you won’t have to ship a new app build for changing how your view looks. You can change your theme by contacting Zeta and it will reflect on your app on the next launch.

  3. Configure properties To enable authentication using face recognition (Face ID), add a value to the NSfaceIdUsageDescription (Privacy - Face ID Usage Description) with a message in the info.plist file.

3. Initialize the SDK

Create the ApolloCardManager instance in your AppDelegate file. Initialize it inside the applicationdidFinishLaunchingWithOptions: method of your Applicationclass. Keep the instance for ApolloCardManager globally accessible.

Sample cURL

Switch Theme
Expand More
Copy
1
2
3
4
5
6
7
8
#import "AppDelegate.h"
#import <ApolloCards_Framework/ApolloCards_Framework.h>
@implementation AppDelegate
 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.cardManager = [[ApolloCardManager alloc] init];
    return YES;
}
Code Copied

4. Integrating the SDK

Card SDK is a stateful SDK. Before you start using the Card SDK features, take care of the following :

  1. Authenticating the SDK

For a user of your app to be able to use the cards SDK through your app, you need to authenticate the user with the tenantAuthToken. The tenantAuthToken needs to be computed in your backend as it needs sensitive information to create the token. The information used to generate the tenantAuthToken should never be compromised.

Set the tenantAuthToken to the cards SDK once the user logs into your app and you have sufficient information to issue a tenantAuthToken for the user. More information here on how to generate the tenantAuthToken can be found here. Following is a code snippet on how to authenticate the SDK :

Sample cURL

Switch Theme
Expand More
Copy
1
2
  
[self.cardManager authenticateSDKWithTenantAuthToken:@"JWT_TOKEN"                          andAccountHolderID:@"ACCOUNT_HOLDER_ID"];
Code Copied

Note: This step has to be performed in a fresh log-in of the user or when the earlier provided tenantAuthToken expires.

Note: A tenantAuthToken has an associated validity with it. The ideal practice is to reset a new token before it expires.

  1. Setting up the SDK

Note: Ensure that this step is performed only after you have SDK authentication in place

  • Basic setup

This step has to be performed on every launch of the app (post the authentication of the SDK). You can perform this inside the onCreate() method of your launching activity.

Sample cURL

Switch Theme
Expand More
Copy
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  
- (void) setUpSDK {
    [self.cardManager setUpSDKWithSuccess:^{
        NSLog(@"SDK initialised successfully");
 
    } failure:^(ApolloCardErrorInfo *userInfo) {
        NSLog(@"SDK initialisation failed with error %@", userInfo.message);
    }];
}
 
Code Copied

  • Advanced setup For storing the card details and authentication information securely, we use encrypted storage and hide the data behind the user’s authentication. If you are an issuer, you can provide a custom implementation of your own encrypted storage. This is how you can achieve it :

Sample cURL

Switch Theme
Expand More
Copy
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  
#import "EncryptedStore.h"
 
@interface EncryptedStore()<AppSecuredStoreAccess>
 
@end
 
@implementation EncryptedStore
 
- (void)dataForKey:(NSString *)key completion:(void (^)(NSError *, NSData *))completion {
    // code to get data and pass data in completion block
    completion(nil, [NSData data]);
}
 
- (void)setData:(NSData *)data forKey:(NSString *)key completion:(void (^)(NSError *))completion {
    // code to save data
    if(completion) {
        completion(nil);
    }
}
 
- (void)resetAllData {
    // code to delete all data
}
 
@end

 
Code Copied

Listen to the listener for success. You can access the Cards SDK APIs post that.