Giter Site home page Giter Site logo

tp-lab / mobile-sdk Goto Github PK

View Code? Open in Web Editor NEW
114.0 15.0 46.0 38.69 MB

Android and iOS native SDK, developer can use this sdk to pull up TokenPocket wallet and do actions such as token transfer,push action, login etc. MiniWallet supported now.

Objective-C 2.94% Java 3.26% JavaScript 93.72% C 0.09%
eosio dapp defi evm gamefi web3 blockchain

mobile-sdk's Introduction

mobile-sdk's People

Contributors

chendatony31 avatar developmc avatar ejhanrienaout avatar giki0318 avatar nehcnoraa avatar nullpointerduke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobile-sdk's Issues

This is an iOS question.

#import "AppDelegate.h"
#import <TPSDK/TPSDK.h>

@interface AppDelegate ()

@EnD

@implementation AppDelegate

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

    [TPApi registerAppID:@"demoapp"];

    [TPApi enableLog:YES];
    [TPApi setPayResourceSwitch:YES forAccount:@"verycoolcool"];

    NSError *err;
    [TPApi setSeed:@"12345678" error:&err];
    if (err) {
    NSLog(@"%@", err.localizedDescription);
    }

    [TPApi setBlockChain:TPBlockChainTypeEOSMainNet nodeUrl:@"http://eosinfo.mytokenpocket.vip" plugNodeUrl:@"http://eosinfo.mytokenpocket.vip"];

    return YES;
    }

code : [TPApi enableLog:YES]; <---- error
-[NSUserDefaults tb_setObject:forKey:inGroup:]: unrecognized selector sent to instance 0x28243c0c0 <---
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSUserDefaults tb_setObject:forKey:inGroup:]: unrecognized selector sent to instance 0x2812ee940'
*** First throw call stack:
(0x19b40b928 0x1af1aa480 0x19b31a960 0x19b40df84 0x19b40ff2c 0x102274a0c 0x102276130 0x102272190 0x19dcad7b0 0x19dcaf150 0x19dcb4f24 0x19d3878c0 0x19d8ac2c8 0x19d3883a8 0x19d387eb0 0x19d3881d4 0x19d387a90 0x19d38f72c 0x19d7c638c 0x19d8c4184 0x19d38f420 0x19d1ceae4 0x19d1cd590 0x19d1ce730 0x19dcb30fc 0x19d7eca84 0x1a9eeed00 0x1a9f164fc 0x1a9efc420 0x1a9f16214 0x10262d32c 0x1026307e4 0x1a9f3ae04 0x1a9f3aacc 0x1a9f3afa0 0x19b38afa8 0x19b38aea8 0x19b38a1fc 0x19b384718 0x19b383ed0 0x1b1acf570 0x19dcb12d0 0x19dcb684c 0x102273b18 0x19b062140)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSUserDefaults tb_setObject:forKey:inGroup:]: unrecognized selector sent to instance 0x2812ee940'
terminating with uncaught exception of type NSException

May I know what is causing the error?
A framework has also been added to see additional sample code.

IOS SDK怎么登陆polygon/matic网络?

使用以下代码,始终找不到网络。

login.blockchains = @[
    [TPChainObj objWithNetwork:@"matic" chainId:@"1"],
    [TPChainObj objWithNetwork:@"eth" chainId:@"56"],
    [TPChainObj objWithNetwork:@"ethereum" chainId:@"56"]
];
login.wallet = @"TokenPocket";



[TPApi sendObj:login];

使用sdk报错了

调用authorize方法后报错:Invoker authorize exception:java.lang.reflect.InvocationTargetException
这该咋办?

请问如何获取actionId

Android的demo中跳转tp钱包需要一个actionId的参数,请问这个是从哪获取的
另外是否可以从App内直接跳转到tp钱包的dapp内呢

谁在使用 TP Mobile-SDK ? Who's Using TP Mobile-SDK?

谁在使用 TP Mobile-SDK ?

我们希望通过这个 issue 收集使用Mobile-SDK 的项目信息,并借此与社区建立更多的联系,了解 SDK 的使用场景、方式及遇到的问题,以更好的推动 Web3.0 的生态发展。

您可以告诉我们使用 Mobile-SDK 的经验及遇到的问题,包括但不限于:

  • 接入使用SDK遇到了哪些问题,文档是否完整。
  • 希望SDK能提供或支持哪些功能。
  • 任何对SDK的建议。

同时,也欢迎您留下项目相关信息,让社区看到更多Web3.0的交互和生态:

  • 您的项目名称、官网地址
  • 联系方式:邮箱、电报等

Who's Using TP Mobile-SDK?

We hope to collect information on projects using Mobile-SDK through this issue, and establish more contacts with the community to understand the usage scenarios, methods and problems of the SDK, so as to better promote the ecological development of Web3.0.

You can tell us about your experience and problems using Mobile-SDK, including but not limited to:

  • What problems did you encounter when accessing the SDK, and whether the documentation is complete.
  • What features do I hope the SDK can provide or support.
  • Any suggestion for SDK.

At the same time, you are also welcome to leave project-related information, so that the community can see more interaction and ecology of Web3.0:

  • Your project name, official website address
  • Contact: email, telegram, etc.

message length is invalid

iOS SDK sign message length is invalid
使用iOS demo 登录没有问题,签名弹出message length is invalid

Swift 接入sdk的时候崩溃

#5 0x000000010484b5b4 in __49-[TPPayResourceService loadResourceServiceConfig]_block_invoke at /Users/ica/repo/TPiOSSDK/TPSDK/TPSDK/PayResource/TPPayResourceService.m:107
签名成功返回app时在这里崩溃

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.63.0
  • OS Version: Ubuntu 20.04.1

Steps to Reproduce:

  1. Create a functional React component
  2. Inside the element's return create a React Fragment
  3. Inside the fragment's scope type "<" and start typing a html element name until intellisense suggests some. Type tab or enter. Instead of "button" for example, it will place "button={}"

Originally posted by @ericsj in microsoft/TypeScript#47090

调用mobile sdk 唤起tp钱包后一直报“非法参数”

工程师您好,请教下您一个问题我用你们的demo,能把tp唤起,但是不能执行,总是报“非法参数”,能否帮忙。谢谢
binding.button.setOnClickListener(new View.OnClickListener(){
@OverRide
public void onClick(View v) {
Authorize authorize = new Authorize();
//已废弃
//authorize.setBlockchain(CHAIN);
//标识链
List blockchains = new ArrayList();
//blockchains.add(new Blockchain("ethereum", "56"));
blockchains.add(new Blockchain("ethereum", "56"));
authorize.setBlockchains(blockchains);
authorize.setAction("login");
authorize.setActionId(String.valueOf(System.currentTimeMillis()));
authorize.setProtocol("TokenPocket");
authorize.setVersion("v1.0");
authorize.setDappName("zs");
authorize.setDappIcon("https://eosknights.io/img/icon.png");
authorize.setMemo("demo");
authorize.setCallbackUrl("http://115.205.0.178:9011/taaBizApi/taaInitData");
//2分钟
authorize.setExpired(1602);
TPManager.getInstance().authorize(MainActivity.this, authorize, new TPListener() {
@OverRide
public void onSuccess(String s) {
String cc=s+"mmm";
Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
}

            @Override
            public void onError(String s) {
                String cc = s+"ccc";
                Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();

            }

            @Override
            public void onCancel(String s) {
                String cc = s+"eeeee";
                Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();

            }
        });
    }
});
binding.button4.setOnClickListener(new View.OnClickListener(){
    @Override
    public void onClick(View v) {
        Toast.makeText(MainActivity.this,"ttttt",Toast.LENGTH_LONG).show();
        Transfer transfer = new Transfer();
        //已废弃
        //transfer.setBlockchain("EOS");
        //标识链
        List<Blockchain> blockchains = new ArrayList<>();
        blockchains.add(new Blockchain("ethereum", "56"));
        transfer.setBlockchains(blockchains);
        transfer.setAction("transfer");
        transfer.setActionId(String.valueOf(System.currentTimeMillis()));
        transfer.setDappName("zs");
        transfer.setDappIcon("https://eosknights.io/img/icon.png");
        transfer.setFrom("0x0c5dBa0A59776c3C31c31ac1C19AaFAeb800d1E8");
        transfer.setTo("0x341Bb9895e7F6E76e89B93BDCa19364470D71a83");
        transfer.setAmount(0.0001);
        transfer.setContract("0xe10EBE772A01D53745a5a6DAc9C67fFb39C0b40F");
        transfer.setSymbol("TAA");
        transfer.setPrecision(18);
        transfer.setMemo("test");
        transfer.setExpired(1535944144L);
        transfer.setCallbackUrl("http://115.205.0.178:9011/taaBizApi/taaInitData");


        TPManager.getInstance().transfer(MainActivity.this, transfer,new TPListener() {
            @Override
            public void onSuccess(String data) {
                String cc = data+"ccc";
                Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
            }

            @Override
            public void onError(String data) {
                String cc = data+"ccc";
                Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
            }

            @Override
            public void onCancel(String data) {
                String cc = data+"ccc";
                Toast.makeText(MainActivity.this, cc, Toast.LENGTH_LONG).show();
            }
        });
    }
});

}

iOS新版TP Wallet不支持拉起

TP Wallet Version: 2.0.4
使用下载的TP SDK,无法拉起登录。
Safari输入 tpoutside:// 也无法拉起, "address is invalid"

How to verify the Android authorized signature on the server?

This is my android authorize code:

        Authorize authorize = new Authorize();
        List blockchains = new ArrayList();
        blockchains.add(new Blockchain("ethereum", "56"));
        authorize.setBlockchains(blockchains);
        authorize.setAction("login");
        authorize.setActionId(String.valueOf(System.currentTimeMillis()));
        authorize.setProtocol("TokenPocket");
        authorize.setVersion("v1.0");
        authorize.setDappName("testApp");
        authorize.setMemo("demo");
        TPManager ins = TPManager.getInstance();

After onsuccess,How to verify the correctness of the signature on the server. For example, this is the code of metamask:

              TypedData := &eip712.TypedData{
		Types: eip712.Types{
			"EIP712Domain": []eip712.Type{
				{Name: "name", Type: "string"},
				{Name: "version", Type: "string"},
				{Name: "chainId", Type: "uint256"},
			},
			"login": []eip712.Type{
				{Name: "wallet", Type: "address"},
			},
		},

		Domain: eip712.TypedDataDomain{
			Name:              "login",
		},

		PrimaryType: "login",
		Message: eip712.TypedDataMessage{
			"wallet":        address,
		},
	}
	pubKey, err := beeCrypto.RecoverEIP712(common.Hex2Bytes(sign), TypedData)

This is a security issue. I hope you can let me know. thank you.

如何用web3j把 web3.utils.soliditySha3 实现出来

给个例子
web3.utils.soliditySha3({t: 'string', v: 'Hello!%'}, {t: 'int8', v:-23}, {t: 'address', v: '0x85F43D8a49eeB85d32Cf465507DD71d507100C1d'});

"0xa13b31627c1ed7aaded5aecec71baf02fe123797fffd45e662eac8e06fbe4955"

http://cw.hubwiz.com/card/c/web3.js-1.0/1/8/8/

这个就是新加的 签名那个

要对访问合约做身份验证

这个已经后台做好了。 我现在是要把参数做sha3的计算

在做sha3计算的时候, 我需要用web3j来实现 web3js里面的web3.utils.soliditySha3

Dapp Browser Tron

Hi,
I am developing dapp browser for tron in android. i have searched but coud'nt find any sources or documentation to proceed. Can you help me with that? or any guide or reference. please suggest me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.