iOS

SDK Integration Guide

Import SDK

GitHub: TP iOS SDKarrow-up-right

Download the TPSDK.zip in the GitHub repositoryarrow-up-right. Unzip TPSDK.zip and add it into your Xcode project;

  1. Set your URL scheme: Project->TARGETS->info->URL Types->Add URL scheme;

  2. Add an item LSApplicationQueriesSchemes in the info.plist,value with tpoutside;

Initializing

  • Add related .h file in AppDelegate.m

#import <TPSDK/TPSDK.h>
  • Register your app scheme in method application:didFinishLaunchingWithOptions:

[TPApi registerAppID:@"demoapp"];
  • Handle callback in method application:openURL:

[TPApi handleURL:url options:options result:^(TPRespObj *respObj) {
    respObj.result;     // TPRespResultCanceled = 0,TPRespResultSuccess, TPRespResultFailure,
    respObj.message;    // Result message
    respObj.data;       // Json details
    /* Json details:
    {
        "result" : 1,
        "action" : "sign",
        "version" : "1.0",
        "protocol" : "TPProtocol",
        "ref" : "TokenPocket",
        "wallet" : "xxx...xxx",       // When success
        "publickey" : "xxx...xxx",    // When success
        "permissions" : [             // When success; for eosio/iost networks.
            "active",
            "owner"
        ],
        ...,
    }
    */
}];

Supported Operations

iOS

Sign

Push Transaction

Demo

Login Authorization

Sign

Push Transaction

EthGetEncryptionPublicKey

EthDecrypt

Last updated