gpt4 book ai didi

Android : How to send app invite message using whatsapp, 来 self 的应用程序的 facebook、gmail 等

转载 作者:搜寻专家 更新时间:2023-11-01 08:27:52 25 4
gpt4 key购买 nike

我需要通过 whatsapp、facebook、hike... 将应用邀请消息从我的应用发送给 friend ,其中包含消息和 playstore 链接。我在 hike、whatscall 等其他应用中看到过这种邀请...如下图所示。 hike and whatscall

我也想为我的应用程序发送带有 Playstore 链接和应用程序 Logo 的完全相同类型的消息,并且应该使用用户移动设备中所有可用的共享选项进行共享。在我的应用程序中,我包含了一个通知 friend 菜单和单击该功能应该可以工作。我看过 firebase 应用程序邀请示例,但它需要 google-services.json,我认为它只会从用户电子邮件发送短信,我不确定。

最佳答案

您需要按如下方式创建一个 Intent,以允许您使用任何其他应用共享您的应用:

    try { 
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_SUBJECT, "My app name");
String strShareMessage = "\nLet me recommend you this application\n\n";
strShareMessage = strShareMessage + "https://play.google.com/store/apps/details?id=" + getPackageName();
Uri screenshotUri = Uri.parse("android.resource://packagename/drawable/image_name");
i.setType("image/png");
i.putExtra(Intent.EXTRA_STREAM, screenshotUri);
i.putExtra(Intent.EXTRA_TEXT, strShareMessage);
startActivity(Intent.createChooser(i, "Share via"));
} catch(Exception e) {
//e.toString();
}

关于Android : How to send app invite message using whatsapp, 来 self 的应用程序的 facebook、gmail 等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43086226/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com