如何让android建议我的应用程序从whatsapp发送打开位置



我在清单中添加了一个深度链接

我添加了这个主机";maps.google.com";我从whatsapp的位置找到的但是不起作用

我试过

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="maps.google.com"
android:pathPrefix="/maps"
android:scheme="http" />
<data
android:host="maps.google.com"
android:pathPrefix="/maps"
android:scheme="https" />
</intent-filter>

就像manifest中定义的其他深度链接一样,我希望android在消歧对话框中建议应用程序。。。有人能帮我吗?

您必须实现地理服务活动

地理服务活动从在线地图服务捕获android.intent.action.VIEW。下面是一个工作示例:

舱单

<!-- get geo-location from online mapservices (google, yandex, here, openstreetmap)  -->
<intent-filter>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="maps.google.com" />
<data android:host="maps.google.de" />
<data android:host="www.openstreetmap.org" />
<data android:host="openstreetmap.org" />
<data android:host="maps.yandex.ru" />
<data android:host="maps.yandex.com" />
<data android:host="here.com" />
<data android:host="www.here.com" />
<data android:host="share.here.com" />
<data android:host="goto.here.com" />
<data android:host="go.here.com" />
<data android:host="wego.here.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

地理服务活动

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

Intent intent = getIntent();

if (intent != null) {
Object uri = intent.getData();
message.append(MessageFormat.format("Received action:{0}n - data:{1}n", intent.getAction(), uri));
if (uri != null) {
// parse uri
.... process uri

最新更新