NON-UI framework

NON UI sdk, only consumes QuikWallet(QW) API. Check server documentation shared with you for knowing exactly what are the API and parameters that needs to be sent for each QW provided API.

Integration details

Repository Link: click here

Run this command (you need to have git installed.)

git clone https://bitbucket.org/livquik/qwcore_ios.git

This will download and clone the repository on your machine.

Source Code in this repository has code to show how to consume QuikWallet APIs.

STEP 1 ) Drag and drop QWCore_ios framework in your XCode project.

QWCore_ios.framework file is inside public_release folder of the repository you just cloned

STEP 2) Initialize QWSdk

  • In your AppDelegate.m file first import QWCore_ios/QWSdk.h file

#import <QWCore_ios/QWSdk.h>

  • Optional - This step is needed only if for testing your integration, for production environment this is not needed.

Add the following line to the start of didFinishLaunchingWithOptions.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [QuikWallet setDefaultConfig:@"uat"]; // for testing purposes; not needed for live environment.

    return YES;
}

STEP 3) Usage

// This code snippet explains how to call /cards API using wrapper code.
NSDictionary *dict = @{
                 @"mobile":@"8762070029",
               @"signature":@"55c657c645cfe150f1dad8e891366789211f0397e6b5626cb3b2c8c608390bff",
                 @"partnerid":@"10"
    };

NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithDictionary:dict];


void(^success)() = ^void(id  data){

                NSLog(@”Cards Data %@”, data);
        };

void(^failure)() = ^void(NSError* error) {

    NSDictionary *errorInfo = [error userInfo];

    UIAlertController* alert = [UIAlertController alertControllerWithTitle:@""
                                                  message:[errorInfo objectForKey:@"NSLocalizedDescription"]
                                                  preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
                                                              handler:^(UIAlertAction * action) {}];

        [alert addAction:defaultAction];
        [self presentViewController:alert animated:YES completion:nil];

        };


      // register two callbacks like this code. and handle success and failure.
        QWSdk *qw = [[QWSdk alloc] init];
        [qw getCards:data :success :failure];

STEP 4) Other API

Similar way you can consume other API.

  1. Click QWCore_ios.xcworkspace , this will open in Xcode.
  2. To Find more relevant code, refer QWSdkTest.m file
  3. You need to point to test environment for testing and use test credentials shown in above snippet.