AppGallery Connect:教你如何在快應(yīng)用中跳轉(zhuǎn)到Android的app

來(lái)源: HUAWEI
作者:AppGallery Connect
時(shí)間:2020-11-26
17839
最新遇到一個(gè)需要從快應(yīng)用跳轉(zhuǎn)到Android App的需求,以下記錄下實(shí)現(xiàn)的方式。

background-business-communication-computer-317371.jpg

最新遇到一個(gè)需要從快應(yīng)用跳轉(zhuǎn)到Android App的需求,以下記錄下實(shí)現(xiàn)的方式。

1.在需要跳轉(zhuǎn)的目標(biāo)安卓App的activity中添加對(duì)外的schema,示例代碼如下:

<activity

            android:label="@7F070043"

              android:name="com.huawei.phoneservice.HelpCenterActivity"

             android:exported="true"

              android:excludeFromRecents="true"

               android:launchMode="2"

             android:configChanges="0x40002D84">

                  <intent-filter>

                           <action android:name="android.intent.action.VIEW"></action>

                          <category android:name="android.intent.category.DEFAULT"> </category>

                         <category android:name="android.intent.category.BROWSABLE"></category>

                        <data android:scheme="hwphoneservice" android:host="externalapp"></data>

                </intent-filter>

</activity>

2.在快應(yīng)用中通過system.router.push接口調(diào)用跳轉(zhuǎn),即router.push接口傳入上步配置的schema:

router.push({uri:"hwphoneservice://externalapp/service"})

快應(yīng)用push接口使用方法詳見API文檔:

https://developer.huawei.com/consumer/cn/doc/development/quickApp-References/quickapp-api-router

立即登錄,閱讀全文
版權(quán)說(shuō)明:
本文內(nèi)容來(lái)自于HUAWEI,本站不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。文章內(nèi)容系作者個(gè)人觀點(diǎn),不代表快出海對(duì)觀點(diǎn)贊同或支持。如有侵權(quán),請(qǐng)聯(lián)系管理員(zzx@kchuhai.com)刪除!
優(yōu)質(zhì)服務(wù)商推薦
更多
掃碼登錄
打開掃一掃, 關(guān)注公眾號(hào)后即可登錄/注冊(cè)
加載中
二維碼已失效 請(qǐng)重試
刷新
賬號(hào)登錄/注冊(cè)
個(gè)人VIP
小程序
快出海小程序
公眾號(hào)
快出海公眾號(hào)
商務(wù)合作
商務(wù)合作
投稿采訪
投稿采訪
出海管家
出海管家