首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解析REQUEST_INVITE

无法解析REQUEST_INVITE
EN

Stack Overflow用户
提问于 2017-03-22 00:22:18
回答 1查看 426关注 0票数 0

我想添加防火墙邀请到我的android应用程序。我遵循了教程( https://firebase.google.com/docs/invites/android )中的步骤,但我有以下错误

无法解析符号REQUEST_INVITE

我已经添加了firebase核心并邀请到我的应用程序,当我点击consol中的动态链接时,它没有要求我接受任何东西。

等级:

代码语言:javascript
复制
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:24.2.1'
compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.google.firebase:firebase-invites:10.2.0'
compile 'com.google.firebase:firebase-core:10.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin :'com.google.gms.google-services'

java文件:

代码语言:javascript
复制
    //sent Invite
private void onInviteClicked(){
    Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
            .setMessage(getString(R.string.invit_message))
            .setCallToActionText(getString(R.string.invit_cta))
            .build();
    startActivityForResult(intent, REQUEST_INVITE);
}

google服务json:

代码语言:javascript
复制
"services": {
    "analytics_service": {
      "status": 1
    },
    "appinvite_service": {
      "status": 1,
      "other_platform_oauth_client": []
    },
    "ads_service": {
      "status": 2
    }
  }

还是REQUEST_INVITE是我们必须设置的变量,取决于我们在playstore上应用程序的ID?如果是的话,是否有可能在启动之前知道这个ID?

非常感谢你的帮助

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-22 01:16:18

REQUEST_INVITE只是您在使用它的活动中定义的一个static final int。例如:

代码语言:javascript
复制
private static final int REQUEST_INVITE = 0;

请参阅快速启动样本上的代码。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42940584

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档