2

メールのリンクからアプリを起動したい。このリンクは特別なスキーマに基づいています。

アプリのアクティビティ (AndroidManifest.xml) で使用します。

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="ace" android:host="samuel"/>
</intent-filter>*

私のアプリでは、ユーザーが「メールで共有」ボタンをクリックすると、Gmail アプリが開き、メールが送信されます。

Intent mailIntent = new Intent(android.content.Intent.ACTION_SEND);
mailIntent.setType("plain/test");
mailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_CC, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_BCC, new String[]{});
mailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
mailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailBody));

startActivity(Intent.createChooser(mailIntent, "You need to configure gmail..."));*

「emailBody」には特別な URL リンクが含まれています: ace:adid=9ca98efe-ef48-47c0-aff5-058224b3093d


When I send this email to others, The recipient open the mail, there is no such a special URL link.

I do not know why ? When I use other email (not gmail) send the same html content, It's ok. the recipient can see the special URL link.

4

2 に答える 2

2

フィルタリングが行われている可能性があります。tinyurlを使用することで、同様の制限を回避することができました。小さなphpスクリプトを使用して、getリクエストをace://リンクに変換できます。

于 2011-07-08T08:30:51.363 に答える
2

@Samuel.Cai @Oldarney は、あなたの URL を TinyURL.com に入れ (私があなたのためにやった)、メール本文にこれを入れるように言ったと思います: http://tinyurl.com/a7y2mzn

残念ながら、ブラウザーがそのリダイレクトを行うにはオンラインである必要がありますが、私にとってはうまくいきました。あなたの最も安全な賭けはおそらく行うことです

'emailBody' = ace://samuel?adid=9ca98efe-ef48-47c0-aff5-058224b3093d

リンクが機能しない場合は、ブラウザーにコピーして貼り付けるようにユーザーに指示します。

お役に立てば幸いです。

于 2013-01-14T17:05:26.633 に答える