解析推送:哪个是preferred的方式来唯一地识别设备:installationId或deviceToken? [英] Parse Push: Which is the preferred way to uniquely identify a device: installationId or deviceToken?

查看:138
本文介绍了解析推送:哪个是preferred的方式来唯一地识别设备:installationId或deviceToken?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当发送一个推到一台设备,它是preferred方式,以确定设备

When sending a push to a single device, which is the preferred way to identify that device?

deviceToken

ParseInstallation.getCurrentInstallation().get("deviceToken");

installationId

ParseInstallation.getCurrentInstallation().getInstallationId()

两者之间权衡存在?一会提供比其他更快?

Are there tradeoffs between the two? Will one be available sooner than the other?

推荐答案

我会建议使用的ID而不是设备令牌。该设备令牌可以在不同平台上(iOS或Android)和ID不同格式的(假设为)的安装表的主键,所以可能会有点快。

I would recommend using the id rather than the device token. The device token could be in different formats depending on the platform (iOS or Android) and the id is (assumed to be) a primary key for the installations table, so might be a bit faster.

在这两种情况下,您可以通过使用一个查询或频道名称指定推的对象,所以你的情况,这是你如何创建安装查询,以便对 setQuery 的ParsePush对象的方法。

In either case, you specify the target of a push by using either a query or a channel name, so in your case, it's how you create the installation query to use on the setQuery method of the ParsePush object.

这篇关于解析推送:哪个是preferred的方式来唯一地识别设备:installationId或deviceToken?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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