push-notification - Xamarin.Forms Azure 推送通知 - "MobileServiceInvalidOperationException: You do not have permission to view this directory or page"

标签 push-notification google-cloud-messaging xamarin.forms firebase-cloud-messaging azure-notificationhub

我正在尝试在我的 Xamarin.Forms 应用程序中实现推送通知。
我关注了this Microsoft doc ,但我收到了 Unauthorized 错误

await push.RegisterAsync(RegistrationID, templates);  

线。异常情况如下:
Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException:您无权查看此目录或页面。

我已添加发件人 ID(来自 Firebase)(他们在文档中将其称为“项目编号”)

public class PushHandlerBroadcastReceiver : GcmBroadcastReceiverBase<GcmService>
{
    public static string[] SENDER_IDS = new string[] { "<my_sender_id_here>" };
}

我还将服务器 key (来自 Firebase)添加到 Azure 门户通知中心的“Google (GCM) API key ”。

我已在 AVD 上登录 Google 帐户。 (我还使用 Azure AD B2C 登录了 Azure MobileServicesClient,但我认为这并不重要。)

我找到了other people with this same issue (搜索“权限”,直接链接不起作用),但只有一个实例。但没有人提供解决方案。

我错过了什么?

最佳答案

我猜你只是没有看到我的任何回复,因为我已经回答了六次了。

应用服务推送当前存在问题。该修复需要在 Azure 应用服务中推广,因此速度不会很快。

相反,请查看我的书的第 5 章:http://aka.ms/zumobook - 它提供了您需要的确切替代代码。提供的代码在修复后以及现在都可以工作,因此您的代码不必再次更改。

关于push-notification - Xamarin.Forms Azure 推送通知 - "MobileServiceInvalidOperationException: You do not have permission to view this directory or page",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42125807/

相关文章:

Android - 如果应用程序正在运行,停止(拦截)C2DM 推送通知?

android - 使用待定 Intent 区分按钮点击

ios - 为什么 UNNotificationContent 的附件属性是一个 NSArray(相对于单个 UNNotificationAttachment)?

android - android pushwoosh他方法'java.io.File android.support.v4.content.ContextCompat

php - Chrome 错误 500 的谷歌云消息传递

适用于 Windows 桌面应用程序的 Xamarin 窗体?

c# - Xamarin Forms Tap 手势识别器 Ios 不起作用

android - 我可以在我的应用程序中同时使用 GCM 和 FCM 吗?

android - 接收不同标准的多个推送通知并根据该标准更新通知

c# - 在 Xamarin Forms 中将 Android API 目标级别从 11 升级到 12