meet-one / meet-js-sdk

Library for MEET.ONE wallet client, better Typescript support, better friendly APIs
https://meet-common.gitlab.io/fe/meet-js-sdk/index.html
MIT License
4 stars 1 forks source link

integrating meet.one wallet #1

Open gaboesquivel opened 5 years ago

gaboesquivel commented 5 years ago

Hi, I'm adding meet one the supported wallets on a web app. Is it posible to load an app on meet.one from the browser ?
On token pocket you can use this protocol https://git.io/fjMOQ I want to accomplish the same with Meet.one. I would also like to switch to fullscreen on load?

wujunchuan commented 4 years ago

I'm sorry if I've kept you waiting.

load an app on meet.one from the browser

We have already supported invoke wallet in external browser(not in dapps browsers in MEET.ONE client)

<a href="meetone://app/webview?params=JTdCJTIydXJsJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZtZWV0Lm9uZSUyRiUyMiUyQyUyMnRpdGxlJTIyJTNBJTIyJUU3JUIxJUIzJUU3JTg5JUI5JUU3JThFJThCJTIyJTdE&callbackId=">Open url with MEETONE</a>

But the scheme maybe unreadable, so we add one parameter external to invoke wallet, and wallet.isExternal is detected wheter in external browsers or not. (meet-js-sdk version >0.1.1 avaliable).

Supported schemes are wallet.webview() and wallet.navigate()

For example :

testWebview = async e => {
  executing(e)
  try {
    let result = await wallet.webview(
      'https://meet.one?nav_alpha=1',
      // if true, invoke the wallet client and execute scheme, if false, will execute scheme only
      wallet.isExternal
    )
    if (result.code === 0) {
      success(e)
    } else {
      failed(e)
    }
    return true
  } catch (error) {
    failed(e)
  }
}

using meet-js-sdk to control fullscreen

No yet, we haven't supported now, but this Library will update continuously, some new schemes will update next version(control fullscreen need wallet client support). If we support this feature, I will mention you in this issue.

gaboesquivel commented 4 years ago

Great, thanks