不使用Azure托管应用程序/后端时如何捕获设备安装ID? [英] How can I trap a device installation ID when not using an Azure hosted app/back-end?

查看:98
本文介绍了不使用Azure托管应用程序/后端时如何捕获设备安装ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理的项目将使用设备的安装ID将通知发送到特定设备.我已经成功使用Azure通知中心和Azure上托管的后端应用程序成功使通知适用于iOS和Android 作为模拟.

The project I am working on will be using the device's installation ID to send notifications to a specific device. I have successfully managed to make notifications work for iOS and Android using the Azure Notification Hub and a back-end app hosted on Azure as a mock up.

我现在想继续使用通知中心,但是实际项目不会在Azure平台上托管后端应用程序.

I would now like to continue using the notification hub, however the actual project will not have a back-end app hosted on the Azure platform.

我当前捕获每个设备的安装ID的方式是使用下面的代码,其中MobileServiceUrl是包含我Azure托管后端地址的常量字符串.

The way I currently trap the installation ID of each device is using the code below, where MobileServiceUrl is a constant string containing the address of my Azure hosted back-end. 

var client = new MobileServiceClient(App.MobileServiceUrl);
                var push = client.GetPush();

var client = new MobileServiceClient(App.MobileServiceUrl);
                var push = client.GetPush();

我的问题是,有没有办法可以在不使用Azure后端的情况下捕获安装ID?

My question is, is there a way that I can trap the installation ID without using the Azure back-end?

捕获安装ID既可以在客户端应用程序/设备端发生,也可以通过后端项目进行,可能使用CreateOrUpdateInstallationAsync方法.

Trapping the installation ID could either happen in the client app/device side, or through the back-end project, possibly using the CreateOrUpdateInstallationAsync method.

我们现有的后端项目是一个由各种CRUD调用组成的WebAPI项目.

Our existing back-end project is a WebAPI project made up of various CRUD calls.

如果有人对这种情况有解决方案或可以提供建议,我将非常感激.

If anyone has a solution for this situation or could offer advice I would be very grateful.

谢谢

罗斯

推荐答案

您好,

Hi 

请忽略前面的消息,我想我将能够使用设备GUID作为安装ID(Guid.NewGuid()),然后从客户端应用程序创建安装.

Please disregard previous message, I think I will be able to use the device GUID as the installation ID (Guid.NewGuid()), then create the installation from the client app.

谢谢

罗斯


这篇关于不使用Azure托管应用程序/后端时如何捕获设备安装ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆