本演示项目在Unity for Android Build中启用部分华为HMS和AGC服务,对应的类和函数的名称和用法相同。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

11 KiB

HuaweiService.applinking

Scenario: initialization初始化

Description Api Reference
Initializes the AGConnectAppLinking instance.
初始化AGConnectAppLinking实例
AGConnectAppLinking getInstance() AGConnectAppLinking

Scenario: Create a Build object and set AppLinking parameters创建Build对象,设置AppLinking参数

Description Api Reference
Generates a long link.
生成长链接
builder.buildAppLinking() AppLinking.Builder
Asynchronously generates a short link.
异步生成短链接
builder.buildShortAppLinking() AppLinking.Builder
Asynchronously generates a short link with a string-type suffix.
异步生成指定长短的短链接
builder.buildShortAppLinking(ShortAppLinking.LENGTH length) AppLinking.Builder
Sets information about the Android app where a link of App Linking is to be opened.
设置打开App Linking的安卓应用信息
Builder setAndroidLinkInfo(AppLinking.AndroidLinkInfo androidLinkInfo) AppLinking.Builder
Sets the deep link to be contained in a link of App Linking.
设置要App Linking中打开的DeepLink地址
Builder setDeepLink(Uri deepLink) AppLinking.Builder
Sets a long link.
设置长链接地址
Builder setLongLink(Uri longLink) AppLinking.Builder
Sets social sharing identifier information.
设置社交分享标识信息
Builder setSocialCardInfo(AppLinking.SocialCardInfo socialCardInfo) AppLinking.Builder
Sets activity information.
设置活动所需要的数据
Builder setCampaignInfo(AppLinking.CampaignInfo campaignInfo) AppLinking.Builder
Sets a URL prefix for a link of App Linking.
设置App Linking链接地址的网址前缀
Builder setUriPrefix(String uriPrefix) AppLinking.Builder
Sets the link expiration time.
设置链接失效时间
Builder setExpireMinute(long expireMinute) AppLinking.Builder
Sets the preview page style.
设置预览页样式:
APP信息展示
社交卡片展示
Builder setPreviewType(LinkingPreviewType previewType)
public static final AppLinking.LinkingPreviewType AppInfo
public static final AppLinking.LinkingPreviewType SocialInfo
AppLinking.Builder

Scenario: Configure Android application information配置Android应用信息

Description Api Reference
Sets the deep link to an Android app.
设置Android应用的DeepLink
setAndroidDeepLink(String androidDeepLink) AppLinking.AndroidLinkInfo.Builder
Sets the action triggered when the link of an Android app is tapped but the app is not installed.
设置Android应用未安装时的打开方式:
华为应用市场打开详情页
用本地应用市场打开详情页
使用fallbackUrl字段打开
setOpenType(AndroidOpenType openType)
public static final AppLinking.AndroidLinkInfo.AndroidOpenType AppGallery
public static final AppLinking.AndroidLinkInfo.AndroidOpenType LocalMarket
public static final AppLinking.AndroidLinkInfo.AndroidOpenType CustomUrl
AppLinking.AndroidLinkInfo.Builder
Sets a custom URL to be accessed when the app is not installed.
设置自定义跟踪记录属性名称和属性值
setFallbackUrl(String fallbackUrl) AppLinking.AndroidLinkInfo.Builder
Generates Android app information.
生成安卓应用信息
AndroidLinkInfo build() AppLinking.AndroidLinkInfo.Builder

Scenario: Configure social sharing identification information配置社交分享标识信息

Description Api Reference
Sets the preview description displayed during social sharing.
设置社交分享标识信息中的预览说明信息
setDescription(String description) AppLinking.SocialCardInfo.Builder
Sets the address of the preview image displayed during social sharing.
设置社交分享标识信息中的预览图片地址
setImageUrl(String imageUrl) AppLinking.SocialCardInfo.Builder
Sets the preview title for social sharing.
设置社交分享标识信息中的预览标题
setTitle(String title) AppLinking.SocialCardInfo.Builder
Generates social sharing identifier information.
生成App Linking中的社交分享标识信息
SocialCardInfo build() AppLinking.SocialCardInfo.Builder
Generate social sharing identification information
生成社交分享标识信息

Scenario: Configure activity information in AppLinking配置AppLinking中的活动信息

Description Api Reference
Sets the activity name.
设置活动名称
setName(String name) AppLinking.CampaignInfo.Builder
Sets the activity source.
设置活动来源
setSource(String source) AppLinking.CampaignInfo.Builder
Sets the activity medium.
设置活动媒介
setMedium(String medium) AppLinking.CampaignInfo.Builder
Generates activity information.
生成活动信息
CampaignInfo build() AppLinking.CampaignInfo.Builder
Description Api Reference
Obtains a short link.
获取短链接地址
Uri getShortUrl() ShortAppLinking
Obtains the URL for previewing the flowchart of a link of App Linking.
获取预览链接流程的地址
Uri getTestUrl() ShortAppLinking
Specifies whether the string-type suffix of a short link is long or short. This class is used to create a short link.
短链接字符串后缀的长度的常量
ShortAppLinking.LENGTH ShortAppLinking

Scenario: Receive AppLinking接收AppLinking

Description Api Reference
Checks whether there are links of App Linking with data to be received in a specified intent.
查看指定的链接地址是否有待接收的数据
Task getAppLinking(Activity activity)
Task不带泛型,但对使用并无影响
AGConnectAppLinking
Obtains the time when a link of App Linking is tapped.
App Linking被点击的时间
getClickTimestamp() ResolvedLinkData
Obtains the deep link contained in a link of App Linking.
App Linking链接地址中的DeepLink地址
getDeepLink() ResolvedLinkData
Obtains the preview title displayed during social sharing.
获取链接社交标题
getSocialTitle() ResolvedLinkData
Obtains the preview description displayed during social sharing.
获取链接社交描述
getSocialDescription() ResolvedLinkData
Obtains the preview image displayed during social sharing.
获取链接社交图片
getSocialImageUrl() ResolvedLinkData
Obtains the campaign name displayed during social sharing.
获取链接活动名称
getCampaignName() ResolvedLinkData
Obtains the campaign medium.
获取链接活动媒介
getCampaignMedium() ResolvedLinkData
Obtains the campaign source.
获取链接活动来源
getCampaignSource() ResolvedLinkData