@@ -491,38 +491,24 @@ public void OpenDeepLink(AppEntry selectedWallet)
491491 OpenDeepLink ( ) ;
492492 }
493493
494- public void OpenMobileWallet ( )
494+ public virtual void OpenMobileWallet ( )
495495 {
496- #if UNITY_ANDROID
496+ #if UNITY_ANDROID && ! UNITY_EDITOR
497497 var signingURL = ConnectURL . Split ( '@' ) [ 0 ] ;
498-
499- Debug . Log ( "signing url " + signingURL ) ;
500498 string maiarUrl = "https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/?wallet-connect=" + UnityWebRequest . EscapeURL ( signingURL ) ;
501-
502499 Debug . Log ( "[WalletConnect] Opening URL: " + maiarUrl ) ;
503500 Application . OpenURL ( maiarUrl ) ;
504-
505- //Application.OpenURL(signingURL);
506- #elif UNITY_IOS
507-
508- string url ;
509- string encodedConnect = WebUtility . UrlEncode ( ConnectURL ) ;
510-
511- url = "https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com" + "/wc?uri=" + encodedConnect ;
512-
513-
514- var signingUrl = url . Split ( '?' ) [ 0 ] ;
515-
516- Debug . Log ( "Opening: " + signingUrl ) ;
517- Application . OpenURL ( signingUrl ) ;
518-
501+ #elif UNITY_IOS && ! UNITY_EDITOR
502+ string maiarUrl = "https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com" + "/wc" ;
503+ Debug . Log ( "[WalletConnect] Opening URL: " + maiarUrl ) ;
504+ Application . OpenURL ( maiarUrl ) ;
519505#else
520506 Debug . Log ( "Platform does not support deep linking" ) ;
521507 return ;
522508#endif
523509 }
524510
525- public void OpenDeepLink ( )
511+ public virtual void OpenDeepLink ( )
526512 {
527513 if ( ! ActiveSession . ReadyForUserPrompt )
528514 {
@@ -533,31 +519,15 @@ public void OpenDeepLink()
533519 }
534520
535521#if UNITY_ANDROID
536- Debug . Log ( "[WalletConnect] Opening URL: " + ConnectURL ) ;
537- Application . OpenURL ( ConnectURL ) ;
538- #elif UNITY_IOS
539- if ( SelectedWallet == null )
540- {
541- throw new NotImplementedException (
542- "You must use OpenDeepLink(AppEntry) or set SelectedWallet on iOS!" ) ;
543- }
544- else
545- {
546- string url ;
547- string encodedConnect = WebUtility . UrlEncode ( ConnectURL ) ;
548- if ( ! string . IsNullOrWhiteSpace ( SelectedWallet . mobile . universal ) )
549- {
550- url = SelectedWallet . mobile . universal + "/wc?uri=" + encodedConnect ;
551- }
552- else
553- {
554- url = SelectedWallet . mobile . native + ( SelectedWallet . mobile . native . EndsWith ( ":" ) ? "//" : "/" ) +
555- "wc?uri=" + encodedConnect ;
556- }
522+ string maiarUrl = "https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/?wallet-connect=" + UnityWebRequest . EscapeURL ( ConnectURL ) ;
523+ Debug . Log ( "[WalletConnect] Opening URL: " + maiarUrl ) ;
524+ Application . OpenURL ( maiarUrl ) ;
557525
558- Debug . Log ( "Opening: " + url ) ;
559- Application . OpenURL ( url ) ;
560- }
526+ #elif UNITY_IOS
527+ string encodedConnect = WebUtility . UrlEncode ( ConnectURL ) ;
528+ string maiarUrl = "https://maiar.page.link/?apn=com.elrond.maiar.wallet&isi=1519405832&ibi=com.elrond.maiar.wallet&link=https://maiar.com/?wallet-connect=" + encodedConnect ;
529+ Debug . Log ( "[WalletConnect] Opening URL: " + maiarUrl ) ;
530+ Application . OpenURL ( maiarUrl ) ;
561531#else
562532 Debug . Log ( "Platform does not support deep linking" ) ;
563533 return ;
0 commit comments