我想通过 fcm 向离线用户发送通话报价消息 (sdp) 。但问题是fcm的限制是4096字节,并且在视频通话的情况下,通话报价的 sdp 超出了此限制。
我的呼叫报价机制:用户为远程对等点创建呼叫报价消息,获取该消息并通过 SocketIO 将其发送到服务器。然后服务器检查远程对等点是否在线(通过套接字连接)。
现在,如果远程用户离线,我需要通过推送通知将 sdp 发送给用户。
我解决这个问题的方法正确吗?或者我是否需要更改机制以首先发出呼叫要约信号,然后当远程用户收到通知时,我生成呼叫要约并使用我的 SocketIO 传输 sdp
我正在为 Android 实施 firebase 电子邮件链接身份验证机制。我已经使用 firebase 的指南实现了它。但是现在从电子邮件打开链接后,应用程序总是会转到启动器活动。我无法调试问题。我还在我的应用程序中实现了动态链接,效果很好。这是我的意图过滤器:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.example.com" />
<data android:pathPrefix="/emailSignInLink" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的 ActionCodeSetting:
ActionCodeSettings settings = ActionCodeSettings.newBuilder()
.setAndroidPackageName(
BuildConfig.APPLICATION_ID,
false, /* install if not available? */
null /* minimum app version */)
.setHandleCodeInApp(true)
.setUrl("https://www.example.com/emailSignInLink")
.build();
Run Code Online (Sandbox Code Playgroud)
谁能弄清楚我在这里做错了什么或遗漏了什么
来自 firebase 的示例:
https://github.com/firebase/quickstart-android/blob/master/auth/app/src/main/AndroidManifest.xml
编辑 1:
我通过在我的启动器活动的 onResume 数据中记录意图数据进行了检查,并且我正在获取 Firebase 身份验证返回的数据,所以我认为它看起来像是动态链接的某种问题。
我的 firebase 邀请版本是 15.0.0,因为 15.0.2 给了我错误(在文档中更新,但我认为没有实际发布。)
implementation "com.google.firebase:firebase-invites:15.0.0"
编辑 2: 将 firebase 示例用于无密码登录示例时,也存在同样的问题。我在 …
我正在尝试在 firebase 上部署我的功能,而不需要将service-account.json文件添加到我的项目中。这在部署时给我的某些功能随机带来了以下错误:
构建环境错误
我正在使用的解决方案在firebase 文档中给出以供使用
admin.initializeApp(functions.config().firebase);
Run Code Online (Sandbox Code Playgroud)
如果使用上述初始化的所有函数的部署都成功,那么当我尝试使用 admin sdk 在我的函数中创建自定义令牌时,它会失败并出现以下错误:
Error: createCustomToken() requires a certificate with "private_key" set.
at FirebaseAuthError.Error (native)
at FirebaseAuthError.FirebaseError [as constructor] (/user_code/node_modules/firebase-admin/lib/utils/error.js:39:28)
at FirebaseAuthError.PrefixedFirebaseError [as constructor] (/user_code/node_modules/firebase-admin/lib/utils/error.js:85:28)
Run Code Online (Sandbox Code Playgroud)
使用这个解决方案有什么问题吗?或者如果我们需要铸造自定义令牌,我们是否需要包含 service-account.json 文件?
假设我们想要向两个注册令牌(仅限 Android 设备,无 iOS)发送通知,如下所示:
const tokens = ['tokenA', 'tokenB'];
const payload = {badge: 1, title: 'Hello', body: 'world'};
const options = {priority: 'high',contentAvailable: false, timeToLive: 60 * 60 * 24};
const admin = FirebaseAdmin.initializeApp({/*config here...*/});
admin.messaging().sendToDevice(deviceTokens, payload, options)
.then((response) => {
response.results.forEach((deviceResult) => {
if (deviceResult.error) {
console.log('Delivery failed. Showing result:\n', deviceResult);
}
});
});
Run Code Online (Sandbox Code Playgroud)
设备曾经注册过的用户已从tokenB其设备中删除了该应用程序。因此,该令牌不再在 firebase 中注册。错误对象如下所示:
Delivery failed. Showing result:
{"error":
{
"code":"messaging/registration-token-not-registered",
"message":"The provided registration token is not registered. A previously valid registration token can …Run Code Online (Sandbox Code Playgroud) 在 Android 应用程序中,允许用户使用 Firebase 函数使用 Linkedin 作为登录选项。用户将 linkedin 令牌发送到 firebase 函数,并因此收到AdminSdk生成的Custom token。
现在我们知道令牌可用于登录
mAuth.signInWithCustomToken(mCustomToken)。但我找不到使用自定义令牌生成AuthCredential.
有OAuthProvider类可以生成AuthCredential但重新认证失败。
getCredential(String providerId, String idToken, String accessToken)
有什么办法解决这个问题吗?