Sitelet https://github.com/gobinda99/java/commit/10f6a9d8d0ba1f161433f6d37548777d70be49ba
Skip to content

Commit 10f6a9d

Browse files
author
Devendra
committed
[fixes #75463102]
1 parent 8a8fd74 commit 10f6a9d

51 files changed

Lines changed: 1082 additions & 1082 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎android/Pubnub-Android-3.6.2.jar‎

21 Bytes
Binary file not shown.
21 Bytes
Binary file not shown.

‎android/examples/PubnubExample/src/com/pubnub/examples/pubnubExample10/GcmIntentService.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
public class GcmIntentService extends IntentService {
1717
public static final int NOTIFICATION_ID = 1;
18-
private static final String TAG = "PubnubGcm";
18+
private static final String TAG = "PubnubGcm";
1919
private NotificationManager mNotificationManager;
2020
NotificationCompat.Builder builder;
2121

@@ -31,7 +31,7 @@ protected void onHandleIntent(Intent intent) {
3131
String messageType = gcm.getMessageType(intent);
3232

3333
if (!extras.isEmpty()) {
34-
34+
3535
if (GoogleCloudMessaging.
3636
MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
3737
sendNotification("Send error: " + extras.toString());
@@ -42,9 +42,9 @@ protected void onHandleIntent(Intent intent) {
4242
} else if (GoogleCloudMessaging.
4343
MESSAGE_TYPE_MESSAGE.equals(messageType)) {
4444
Log.i(TAG, "Completed work @ " + SystemClock.elapsedRealtime());
45-
45+
4646
sendNotification(extras.toString());
47-
47+
4848
Log.i(TAG, "Received: " + extras.toString());
4949
}
5050
}

‎android/examples/PubnubExample/src/com/pubnub/examples/pubnubExample10/MainActivity.java‎

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -423,27 +423,27 @@ private void init() {
423423

424424
Map<String, String> map = getCredentials();
425425

426-
// PUBLISH_KEY = map.get("PUBLISH_KEY");
427-
// SUBSCRIBE_KEY = map.get("SUBSCRIBE_KEY");
428-
// SECRET_KEY = map.get("SECRET_KEY");
429-
// CIPHER_KEY = map.get("CIPHER_KEY");
430-
// SSL = (map.get("SSL") == "true")?true:false;
431-
// SENDER_ID = map.get("SENDER_ID");
432-
// AUTH_KEY = map.get("AUTH_KEY");
433-
// ORIGIN = map.get("ORIGIN");
434-
// REG_ID = map.get("REG_ID");
426+
// PUBLISH_KEY = map.get("PUBLISH_KEY");
427+
// SUBSCRIBE_KEY = map.get("SUBSCRIBE_KEY");
428+
// SECRET_KEY = map.get("SECRET_KEY");
429+
// CIPHER_KEY = map.get("CIPHER_KEY");
430+
// SSL = (map.get("SSL") == "true")?true:false;
431+
// SENDER_ID = map.get("SENDER_ID");
432+
// AUTH_KEY = map.get("AUTH_KEY");
433+
// ORIGIN = map.get("ORIGIN");
434+
// REG_ID = map.get("REG_ID");
435435

436436
// The following hardcodes this demo app to run against our beta environment and config.
437437

438438
PUBLISH_KEY = "demo-36";
439439
SUBSCRIBE_KEY = "demo-36";
440440
SECRET_KEY = "demo-36";
441-
CIPHER_KEY = map.get("CIPHER_KEY");
442-
SSL = (map.get("SSL") == "true")?true:false;
443-
SENDER_ID = map.get("SENDER_ID");
444-
AUTH_KEY = map.get("AUTH_KEY");
445-
ORIGIN = "gcm-beta";
446-
REG_ID = map.get("REG_ID");
441+
CIPHER_KEY = map.get("CIPHER_KEY");
442+
SSL = (map.get("SSL") == "true")?true:false;
443+
SENDER_ID = map.get("SENDER_ID");
444+
AUTH_KEY = map.get("AUTH_KEY");
445+
ORIGIN = "gcm-beta";
446+
REG_ID = map.get("REG_ID");
447447
SENDER_ID = "506053237730";
448448

449449

@@ -456,8 +456,8 @@ private void init() {
456456
SSL
457457
);
458458
pubnub.setCacheBusting(false);
459-
pubnub.setOrigin(ORIGIN);
460-
pubnub.setAuthKey(AUTH_KEY);
459+
pubnub.setOrigin(ORIGIN);
460+
pubnub.setAuthKey(AUTH_KEY);
461461

462462
// A SENDER_ID corresponds with a Server API Key with GCM.
463463
// The above Sender ID (506053237730) corresponds to this Server API Key:
@@ -579,26 +579,26 @@ private void gcmAddChannel() {
579579

580580
@Override
581581
public void onClick(DialogInterface dialog, int which) {
582-
583-
if (TextUtils.isEmpty(REG_ID)) {
584-
Toast.makeText(getApplicationContext(),
585-
"GCM Registration id not set. Register to GCM and try again.",
586-
Toast.LENGTH_LONG).show();
587-
return ;
588-
}
582+
583+
if (TextUtils.isEmpty(REG_ID)) {
584+
Toast.makeText(getApplicationContext(),
585+
"GCM Registration id not set. Register to GCM and try again.",
586+
Toast.LENGTH_LONG).show();
587+
return ;
588+
}
589589
String channel = edChannelName.getText().toString();
590-
pubnub.enablePushNotificationsOnChannel(channel, REG_ID, new Callback() {
591-
@Override
592-
public void successCallback(String channel,
593-
Object message) {
594-
notifyUser("GCM ADD : " + message);
595-
}
596-
@Override
597-
public void errorCallback(String channel,
598-
PubnubError error) {
599-
notifyUser("GCM ADD : " + error);
600-
}
601-
});
590+
pubnub.enablePushNotificationsOnChannel(channel, REG_ID, new Callback() {
591+
@Override
592+
public void successCallback(String channel,
593+
Object message) {
594+
notifyUser("GCM ADD : " + message);
595+
}
596+
@Override
597+
public void errorCallback(String channel,
598+
PubnubError error) {
599+
notifyUser("GCM ADD : " + error);
600+
}
601+
});
602602
}
603603
});
604604

21 Bytes
Binary file not shown.

‎android/src/com/pubnub/api/Pubnub.java‎

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
public class Pubnub extends PubnubCoreShared {
18-
18+
1919
/**
2020
* Pubnub Constructor
2121
*
@@ -122,62 +122,62 @@ protected String getUserAgent() {
122122
"; " + android.os.Build.MODEL +
123123
" Build) PubNub-Java/Android/" + VERSION;
124124
}
125-
126-
125+
126+
127127
/**
128128
* Enable Push Notifications (Google Cloud Messaging)
129129
* @param channel
130-
* Channel for which to enable push notifications
130+
* Channel for which to enable push notifications
131131
* @param gcmRegistrationId
132-
* Google Cloud Messaging registration id
132+
* Google Cloud Messaging registration id
133133
*/
134134
public void enablePushNotificationsOnChannel(String channel, String gcmRegistrationId) {
135-
enablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, null);
135+
enablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, null);
136136
}
137-
137+
138138
/**
139139
* Enable Push Notifications (Google Cloud Messaging)
140140
* @param channels
141-
* Channels for which to enable push notifications
141+
* Channels for which to enable push notifications
142142
* @param gcmRegistrationId
143-
* Google Cloud Messaging registration id
143+
* Google Cloud Messaging registration id
144144
*/
145145
public void enablePushNotificationsOnChannels(String[] channels, String gcmRegistrationId) {
146-
enablePushNotificationsOnChannels(channels, gcmRegistrationId, null);
146+
enablePushNotificationsOnChannels(channels, gcmRegistrationId, null);
147147
}
148-
148+
149149
/**
150150
* Enable Push Notifications (Google Cloud Messaging)
151151
* @param channel
152-
* Channel for which to enable push notifications
152+
* Channel for which to enable push notifications
153153
* @param gcmRegistrationId
154-
* Google Cloud Messaging registration id
154+
* Google Cloud Messaging registration id
155155
* @param callback
156-
* Callback object
156+
* Callback object
157157
*/
158158
public void enablePushNotificationsOnChannel(String channel, String gcmRegistrationId, Callback callback) {
159-
enablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, callback);
159+
enablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, callback);
160160
}
161-
161+
162162

163163
/**
164164
* Enable Push Notifications (Google Cloud Messaging)
165165
* @param channels
166-
* Channels for which to enable push notifications
166+
* Channels for which to enable push notifications
167167
* @param gcmRegistrationId
168-
* Google Cloud Messaging registration id
168+
* Google Cloud Messaging registration id
169169
* @param callback
170-
* Callback object
170+
* Callback object
171171
*/
172172
public void enablePushNotificationsOnChannels(final String[] channels, String gcmRegistrationId, final Callback callback) {
173-
final Callback cb = getWrappedCallback(callback);
174-
173+
final Callback cb = getWrappedCallback(callback);
174+
175175
Hashtable parameters = PubnubUtil.hashtableClone(params);
176176
String[] urlargs = null;
177177
urlargs = new String[]{ getPubnubUrl(), "v1", "push", "sub-key",
178178
this.SUBSCRIBE_KEY, "devices", gcmRegistrationId
179179
};
180-
180+
181181
parameters.put("type", "gcm");
182182
parameters.put("add", PubnubUtil.joinString(channels, ","));
183183

@@ -203,62 +203,62 @@ public void handleError(HttpRequest hreq, PubnubError error) {
203203

204204
_request(hreq, nonSubscribeManager);
205205
}
206-
206+
207207
/**
208208
* Disable Push Notifications (Google Cloud Messaging)
209209
* @param channel
210-
* Channel for which to disable push notifications
210+
* Channel for which to disable push notifications
211211
* @param gcmRegistrationId
212-
* Google Cloud Messaging registration id
212+
* Google Cloud Messaging registration id
213213
*/
214214
public void disablePushNotificationsOnChannel(String channel, String gcmRegistrationId) {
215-
disablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, null);
215+
disablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, null);
216216
}
217-
217+
218218
/**
219219
* Disable Push Notifications (Google Cloud Messaging)
220220
* @param channels
221-
* Channels for which to disable push notifications
221+
* Channels for which to disable push notifications
222222
* @param gcmRegistrationId
223-
* Google Cloud Messaging registration id
223+
* Google Cloud Messaging registration id
224224
*/
225225
public void disablePushNotificationsOnChannels(String[] channels, String gcmRegistrationId) {
226-
disablePushNotificationsOnChannels(channels, gcmRegistrationId, null);
226+
disablePushNotificationsOnChannels(channels, gcmRegistrationId, null);
227227
}
228-
228+
229229
/**
230230
* Disable Push Notifications (Google Cloud Messaging)
231231
* @param channel
232232
* @param gcmRegistrationId
233233
* @param callback
234234
*/
235235
public void disablePushNotificationsOnChannel(String channel, String gcmRegistrationId, Callback callback) {
236-
disablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, callback);
236+
disablePushNotificationsOnChannels(new String[]{channel}, gcmRegistrationId, callback);
237237
}
238-
238+
239239
/**
240240
* Disable Push Notifications (Google Cloud Messaging)
241241
* @param channel
242242
* @param callback
243243
*/
244244
/**
245245
* @param channels
246-
* Channels for which to disable push notifications
246+
* Channels for which to disable push notifications
247247
* @param gcmRegistrationId
248-
* Google Cloud Messaging registration id
248+
* Google Cloud Messaging registration id
249249
* @param callback
250-
* Callback object
250+
* Callback object
251251
*/
252252
public void disablePushNotificationsOnChannels(final String[] channels, String gcmRegistrationId, final Callback callback) {
253-
final Callback cb = getWrappedCallback(callback);
253+
final Callback cb = getWrappedCallback(callback);
254+
254255

255-
256256
Hashtable parameters = PubnubUtil.hashtableClone(params);
257257
String[] urlargs = null;
258258
urlargs = new String[]{ getPubnubUrl(), "v1", "push", "sub-key",
259259
this.SUBSCRIBE_KEY, "devices", gcmRegistrationId
260260
};
261-
261+
262262

263263
parameters.put("type", "gcm");
264264
parameters.put("remove", PubnubUtil.joinString(channels, ","));
@@ -286,22 +286,22 @@ public void handleError(HttpRequest hreq, PubnubError error) {
286286
_request(hreq, nonSubscribeManager);
287287
}
288288

289-
289+
290290
/**
291291
* Get channels for which push notification is enabled (Google Cloud Messaging)
292292
* @param gcmRegistrationId
293-
* Google Cloud Messaging registration id
293+
* Google Cloud Messaging registration id
294294
* @param callback
295-
* Callback object
295+
* Callback object
296296
*/
297297
public void requestPushNotificationEnabledChannelsForDeviceRegistrationId(String gcmRegistrationId, final Callback callback) {
298-
final Callback cb = getWrappedCallback(callback);
298+
final Callback cb = getWrappedCallback(callback);
299299
Hashtable parameters = PubnubUtil.hashtableClone(params);
300300
String[] urlargs = null;
301301
urlargs = new String[]{ getPubnubUrl(), "v1", "push", "sub-key",
302302
this.SUBSCRIBE_KEY, "devices", gcmRegistrationId
303303
};
304-
304+
305305

306306
parameters.put("type", "gcm");
307307

@@ -325,31 +325,31 @@ public void handleError(HttpRequest hreq, PubnubError error) {
325325
}
326326
});
327327
}
328-
328+
329329
/**
330330
* Disable push notifications for all channels (Google Cloud Messaging)
331331
* @param gcmRegistrationId
332-
* Google Cloud Messaging registration id
332+
* Google Cloud Messaging registration id
333333
*/
334334
public void removeAllPushNotificationsForDeviceRegistrationId(String gcmRegistrationId) {
335-
removeAllPushNotificationsForDeviceRegistrationId(gcmRegistrationId, null);
335+
removeAllPushNotificationsForDeviceRegistrationId(gcmRegistrationId, null);
336336
}
337337

338338
/**
339339
* Disable push notifications for all channels (Google Cloud Messaging)
340340
* @param gcmRegistrationId
341-
* Google Cloud Messaging registration id
341+
* Google Cloud Messaging registration id
342342
* @param callback
343-
* Callback object
343+
* Callback object
344344
*/
345345
public void removeAllPushNotificationsForDeviceRegistrationId(String gcmRegistrationId, final Callback callback) {
346-
final Callback cb = getWrappedCallback(callback);
346+
final Callback cb = getWrappedCallback(callback);
347347
Hashtable parameters = PubnubUtil.hashtableClone(params);
348348
String[] urlargs = null;
349349
urlargs = new String[]{ getPubnubUrl(), "v1", "push", "sub-key",
350350
this.SUBSCRIBE_KEY, "devices", gcmRegistrationId, "remove"
351351
};
352-
352+
353353

354354
parameters.put("type", "gcm");
355355

0 Bytes
Binary file not shown.
46 Bytes
Binary file not shown.

‎j2me/Pubnub-MicroEdition-3.6.2.jar‎

0 Bytes
Binary file not shown.
21 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)