sách gpt4 ăn đã đi

java - Google AppInvite

In lại 作者:太空狗 更新时间:2023-10-29 13:14:42 27 4
mua khóa gpt4 giày nike

vượt qua Google 手册实现 Google AppInvite - liên kết .

启动 Invite Hoạt động 并在 LogCat 中获取下一步:

E/AppInviteAgent: Get suggested invitees failed due to error code: 3
No Android client ID is found for package name . (APPINVITE_CLIENT_ID_ERROR)

E/AppInviteAgent: Create invitations failed due to error code: 3
No Android client ID is found for package name . (APPINVITE_CLIENT_ID_ERROR)

然后我在onActivityResult 方法中添加一个Log.d 并在LogCat 中获取:

onActivityResult: requestCode=0, resultCode=3

有人可以帮助我吗?我尝试在大约 2 周内修复它。

UPD0

// my `build.gradle` file (project level)
phụ thuộc {
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
classpath 'com.google.gms:google-services:2.0.0-beta6'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
// my `build.gradle` file (app level)

compileSdkVersion 23
buildToolsVersion '23.0.2'
// ... some code
phụ thuộc {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'
// for in-app-billing v3
compile 'com.anjlab.android.iab.v3:library:1.0.31'
}
// and in the end of the file
// for Google Invite
apply plugin: 'com.google.gms.google-services'

// my methods in the MainActivity
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder(
getString(R.string.txt_invitation_title))
.setMessage(getString(R.string.txt_invitation_message))
.setCallToActionText(getString(R.string.txt_invitation_cta))
.xây dựng();
startActivityForResult(intent, REQUEST_INVITE);
}
// where REQUEST_INVITE - private static final int and equal 0;

// and onActivityResult - copy from `Google` manual
@Ghi đè
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
new MyLogs("onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);

if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
// Check how many invitations were sent and log a message
// The ids array contains the unique invitation ids for each invitation sent
// (one for each contact select by the user). You can use these for analytics
// as the ID will be consistent on the sending and receiving devices.
String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
new MyLogs(getString(R.string.sent_invitations_fmt, ids.length));
} khác {
// Sending failed or it was canceled, show failure message to the user
new MyLogs("send_failed");
}
}
}

câu trả lời hay nhất

您是否包含了 json 配置文件?

关于java - 谷歌 AppInvite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36226129/

27 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress