| 237 | /// |
| 238 | /// the device key that can be used to push to this specific device. |
| 239 | public static String getPushKey() { |
| 240 | String key = Preferences.get("push_key", null); |
| 241 | if (key != null) { |
| 242 | if (!key.startsWith("cn1-")) { |
| 243 | String pushPrefix = Display.getInstance().getProperty("cn1_push_prefix", null); |
| 244 | if (pushPrefix != null) { |
| 245 | return "cn1-" + pushPrefix + "-" + key; |
| 246 | } |
| 247 | } else { |
| 248 | return key; |
| 249 | } |
| 250 | } |
| 251 | return null; |
| 252 | } |
| 253 | |
| 254 | /// Subscribes this device to a push topic. Topics are a fan-out mechanism: a single |
| 255 | /// server-side push to a topic is delivered to every device subscribed to it, without |