Usage

How to use NEOPIN Connect SDK

The following information is deprecated and may limit its use. Please refer to the WalletConnect 2.0 tab for the latest version of NEOPIN wallet integration: WalletConnect 2.0

How to run NeopinConnect Dapp Sample App for iOS version is as follows.

1. Open Sample Project

Run Example/NeopinConnect.xcworkspace to load the project.

  • Note: the extension is xcworkspace, not xcodeproj.

2. Check the Scheme

Make sure the schema (box area) is neopin-connect-iOS-DApp. If the schema is not neopin-connect-iOS-DApp, click neopin-connect-iOS-DApp to change.

3. App Allowlist Settings

To run NEOPIN Wallet and NEOPIN Connect Sample Wallet via iOS SDK on iOS 9.0 or higher, you need to set the app Allowlist in the Info.plist file.

This setting is required according to the OS policy for user information protection. For details, see Privacy and Your App.

In [Info] > [Custom iOS Target Properties], add LSApplicationQueriesSchemes, which is an Array type key, and “nptwc” and “examplewalletwc”, which are values to be used for custom URL schemes as [Item] of the key.

4. Change ClientMeta

After opening the ConnectManager.swift file, modify the ClientMeta as shown below.

  • name

    • The name that will be displayed in the NEOPIN Wallet.

  • description

    • The description to be displayed along with the name (Optional)

  • icons

    • The icon address to be displayed in the NEOPIN Wallet.

  • url

    • The URL to be displayed along with the name.

  • appId

    • appId is issued by NEOPIN, and consists of a 32 digit string.

    • ex) NWC1004HS6VFTPPPLUGFQBQ5SFNWB79B

    • The Wallet will reject connection of any appId that were not issued normally.

  • deepLink

    • deepLink is required when connecting to the NEOPIN Wallet or returning to the service app after making a transaction.

    • You must enter the value set in URL Schemes, please refer to the setting method.

    /*
     * name: The name that will be displayed in the NEOPIN Wallet.
     * description: The description to be displayed along with the name (Optional)
     * icons: The icon address to be displayed in the NEOPIN Wallet.
     * url: The URL to be displayed along with the name.
     * appID: appId is issued by NEOPIN, and consists of a 32 digit string.
     * deepLink: deepLink is required when connecting to the NEOPIN Wallet or returning to the service app after making a transaction.
     */
    let clientMetaData = NeopinConnect.Session.ClientMeta(
        name: "NEOPIN DApp(Sample)",
        description: nil,
        icons: [URL(string: "https://picsum.photos/300/300")!],
        url: URL(string: "https://neopin.sample.io")!,
        appId: "NWC1004HS6VFTPPPLUGFQBQ5SFNWB79B",
        deepLink: "neopinconnecttosampledapp"
    )

5. Run Project

Run the project through the Run feature.

6. ConnectManager

After running the project, most of the code associated with NEOPIN Wallet runs in ConnectManager. Please refer to ConnectManager for details.

7. Precautions

  • DApp and Wallet App must all be installed to proceed with the test. If WalletApp is not installed, please check how to install WalletApp.

  • The URL Schemes used by NEOPIN are as follows:

DAppWallet

Sample App

neopinconnecttosampledapp

examplewalletwc

NEOPIN App

your *URL Schemes

nptwc

URL Schemes Settings

Configure [URL Schemes] for NEOPIN Wallet connection and transaction. In [Info] > [URL Types] > [URL Schemes], register the Native App Name in neopinconnectto${NATIVE_APP_name} format. For example, if your Native App Name is "123456789", enter "neopinconnectto123456789" in [URL Schemes].

Last updated