Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
---
changelog:
-
changes:
-
text: "APNS2"
type: improvement
-
text: "Push payload helper class"
type: improvement
date: Dec 24, 19
version: v4.7.0
-
changes:
-
Expand Down Expand Up @@ -359,6 +369,7 @@ features:
others:
- TELEMETRY
- QUERY-PARAM
- CREATE-PUSH-PAYLOAD
presence:
- PRESENCE-HERE-NOW
- PRESENCE-WHERE-NOW
Expand All @@ -381,6 +392,10 @@ features:
- PUSH-REMOVE-DEVICE-FROM-CHANNELS
- PUSH-LIST-CHANNELS-FROM-DEVICE
- PUSH-REMOVE-DEVICE
- PUSH-TYPE-APNS
- PUSH-TYPE-APNS2
- PUSH-TYPE-FCM
- PUSH-TYPE-MPNS
storage:
- STORAGE-REVERSE
- STORAGE-INCLUDE-TIMETOKEN
Expand Down Expand Up @@ -452,4 +467,4 @@ supported-platforms:
- "Ubuntu 12.04+, with Graphics card DX9 (shader model 3.0) or DX11 with feature level 9.3 capabilities; and CPU SSE2 instruction set support."
- "Mac OS X 10.8+, with Graphics card DX9 (shader model 3.0) or DX11 with feature level 9.3 capabilities; and CPU SSE2 instruction set support."
version: "PubNub Unity SDK"
version: v4.6.0
version: v4.7.0
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ public class AddChannelsToPushRequestBuilder: PubNubNonSubBuilder<AddChannelsToP
public AddChannelsToPushRequestBuilder(PubNubUnity pn):base(pn, PNOperationType.PNAddPushNotificationsOnChannelsOperation){
}
private string DeviceIDForPush{ get; set;}
private string TopicForPush{ get; set;}
private PNPushEnvironment EnvironmentForPush{ get; set;}
public void Topic(string topic){
TopicForPush = topic;
}

public void Environment(PNPushEnvironment environment){
EnvironmentForPush = environment;
}

public void Channels(List<string> channelNames){
ChannelsToUse = channelNames;
}
Expand Down Expand Up @@ -45,6 +55,14 @@ public void Async(Action<PNPushAddChannelResult, PNStatus> callback)
#endif
PushType = PNPushType.GCM;
}

if (PushType.Equals(PNPushType.APNS2) && (string.IsNullOrEmpty(TopicForPush))) {
PNStatus pnStatus = base.CreateErrorResponseFromMessage(CommonText.APNS2TopicEmpty, null, PNStatusCategory.PNBadRequestCategory);
Callback(null, pnStatus);

return;
}

base.Async(this);
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ public class ListPushProvisionsRequestBuilder: PubNubNonSubBuilder<ListPushProvi
{
public ListPushProvisionsRequestBuilder(PubNubUnity pn):base(pn, PNOperationType.PNPushNotificationEnabledChannelsOperation){
}

private string TopicForPush{ get; set;}
private PNPushEnvironment EnvironmentForPush{ get; set;}
public void Topic(string topic){
TopicForPush = topic;
}
public void Environment(PNPushEnvironment environment){
EnvironmentForPush = environment;
}
private string DeviceIDForPush{ get; set;}

public void DeviceId(string deviceIdToPush){
Expand All @@ -36,6 +43,14 @@ public void Async(Action<PNPushListProvisionsResult, PNStatus> callback)
#endif
PushType = PNPushType.GCM;
}

if (PushType.Equals(PNPushType.APNS2) && (string.IsNullOrEmpty(TopicForPush))) {
PNStatus pnStatus = base.CreateErrorResponseFromMessage(CommonText.APNS2TopicEmpty, null, PNStatusCategory.PNBadRequestCategory);
Callback(null, pnStatus);

return;
}

base.Async(this);
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ public class RemoveAllPushChannelsForDeviceRequestBuilder: PubNubNonSubBuilder<R
{
public RemoveAllPushChannelsForDeviceRequestBuilder(PubNubUnity pn):base(pn, PNOperationType.PNRemoveAllPushNotificationsOperation){
}
private string TopicForPush{ get; set;}
private PNPushEnvironment EnvironmentForPush{ get; set;}
public void Topic(string topic){
TopicForPush = topic;
}

public void Environment(PNPushEnvironment environment){
EnvironmentForPush = environment;
}
private string DeviceIDForPush{ get; set;}

public void DeviceId(string deviceIdForPush){
Expand All @@ -36,6 +44,14 @@ public void Async(Action<PNPushRemoveAllChannelsResult, PNStatus> callback)
#endif
PushType = PNPushType.GCM;
}

if (PushType.Equals(PNPushType.APNS2) && (string.IsNullOrEmpty(TopicForPush))) {
PNStatus pnStatus = base.CreateErrorResponseFromMessage(CommonText.APNS2TopicEmpty, null, PNStatusCategory.PNBadRequestCategory);
Callback(null, pnStatus);

return;
}

base.Async(this);
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ public class RemoveChannelsFromPushRequestBuilder: PubNubNonSubBuilder<RemoveCha
public RemoveChannelsFromPushRequestBuilder(PubNubUnity pn):base(pn, PNOperationType.PNRemovePushNotificationsFromChannelsOperation){

}
private string TopicForPush{ get; set;}
private PNPushEnvironment EnvironmentForPush{ get; set;}
public void Topic(string topic){
TopicForPush = topic;
}

public void Environment(PNPushEnvironment environment){
EnvironmentForPush = environment;
}
private string DeviceIDForPush{ get; set;}
public void Channels(List<string> channelNames){
ChannelsToUse = channelNames;
Expand Down Expand Up @@ -41,6 +49,13 @@ public void Async(Action<PNPushRemoveChannelResult, PNStatus> callback)
return;
}

if (PushType.Equals(PNPushType.APNS2) && (string.IsNullOrEmpty(TopicForPush))) {
PNStatus pnStatus = base.CreateErrorResponseFromMessage(CommonText.APNS2TopicEmpty, null, PNStatusCategory.PNBadRequestCategory);
Callback(null, pnStatus);

return;
}

base.Async(this);
}
#endregion
Expand Down
Loading