Skip to content

Commit

Permalink
FCM HTTP v1 API (#458)
Browse files Browse the repository at this point in the history
feat(fcm): replacing pn_gcm with pn_fcm
  • Loading branch information
jguz-pubnub authored Jun 12, 2024
1 parent dab0a01 commit 70eabd3
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 34 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ defaults:
run:
shell: bash
env:
TESTS_PAM_PUBLISH_KEY: ${{ secrets.TESTS_PAM_PUBLISH_KEY }}
TESTS_PAM_SUBSCRIBE_KEY: ${{ secrets.TESTS_PAM_SUBSCRIBE_KEY }}
TESTS_PUBLISH_KEY: ${{ secrets.TESTS_PUBLISH_KEY }}
TESTS_SUBSCRIBE_KEY: ${{ secrets.TESTS_SUBSCRIBE_KEY }}
TESTS_PAM_PUBLISH_KEY: ${{ secrets.SDK_PAM_PUB_KEY }}
TESTS_PAM_SUBSCRIBE_KEY: ${{ secrets.SDK_PAM_SUB_KEY }}
TESTS_PUBLISH_KEY: ${{ secrets.SDK_PUB_KEY }}
TESTS_SUBSCRIBE_KEY: ${{ secrets.SDK_SUB_KEY }}
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
Expand Down
15 changes: 10 additions & 5 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: objective-c
scm: github.com/pubnub/objective-c
version: "5.4.1"
version: "5.5.0"
schema: 1
changelog:
- date: 2024-06-12
version: v5.5.0
changes:
- type: feature
text: "Adjusting to FCM HTTP v1 API."
- date: 2024-04-30
version: v5.4.1
changes:
Expand Down Expand Up @@ -1344,7 +1349,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: PubNub.framework
location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.4.1.zip
location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.5.0.zip
supported-platforms:
supported-operating-systems:
macOS:
Expand Down Expand Up @@ -1405,7 +1410,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: PubNub.ios.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.ios.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.5.0/PubNub.ios.xcframework.tar.gz
supported-platforms:
supported-operating-systems:
iOS:
Expand All @@ -1424,7 +1429,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: PubNub.macos.framework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.macos.framework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.5.0/PubNub.macos.framework.tar.gz
supported-platforms:
supported-operating-systems:
macOS:
Expand All @@ -1440,7 +1445,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: PubNub.tvos.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.tvos.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.5.0/PubNub.tvos.xcframework.tar.gz
supported-platforms:
supported-operating-systems:
tvOS:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v5.5.0
June 12 2024

#### Added
- Adjusting to FCM HTTP v1 API.

## v5.4.1
April 30 2024

Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/PubNub-iOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/PubNub-tvOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/PubNub-watchOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.1</string>
<string>5.5.0</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion PubNub.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |spec|
spec.name = 'PubNub'
spec.version = '5.4.1'
spec.version = '5.5.0'
spec.summary = 'The PubNub Real-Time Network. Build real-time apps quickly and scale them globally.'
spec.homepage = 'https://github.com/pubnub/objective-c'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ - (NSDictionary *)dictionaryRepresentationFor:(PNPushType)pushTypes {
NSDictionary *fcmPayload = [self.fcm dictionaryRepresentation];

if (fcmPayload.count) {
payload[@"pn_gcm"] = fcmPayload;
payload[@"pn_fcm"] = fcmPayload;
}
}

Expand Down
2 changes: 1 addition & 1 deletion PubNub/Misc/PNConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#pragma mark General information constants

// Stores client library version number
static NSString * const kPNLibraryVersion = @"5.4.1";
static NSString * const kPNLibraryVersion = @"5.5.0";

// Stores information about SDK codebase
static NSString * const kPNCommit = @"fd5c7ed678527fce07eaf7eb162935caf1bfd303";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PubNub 5.4.1 for iOS 9+
# PubNub 5.5.0 for iOS 9+
[![Twitter](https://img.shields.io/badge/twitter-%40PubNub-blue.svg?style=flat)](https://twitter.com/PubNub)
[![Twitter Releases](https://img.shields.io/badge/twitter-%40PubNubRelease-blue.svg?style=flat)](https://twitter.com/PubNubRelease)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/PubNub.svg?style=flat)](https://img.shields.io/cocoapods/v/PubNub.svg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
},
"pipeline" : false,
"network" : 0,
"url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22pn_other%22:%22Hello%20there%22,%22pn_apns%22:%7B%22aps%22:%7B%22alert%22:%22Hello%20there%22%7D%7D,%22pn_gcm%22:%7B%22data%22:%7B%22hello%22:%22there%22%7D%7D%7D?uuid=serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1"
"url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22pn_other%22:%22Hello%20there%22,%22pn_apns%22:%7B%22aps%22:%7B%22alert%22:%22Hello%20there%22%7D%7D,%22pn_fcm%22:%7B%22data%22:%7B%22hello%22:%22there%22%7D%7D%7D?uuid=serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1"
},
"type" : 0
},
Expand All @@ -97,7 +97,7 @@
"data" : {
"status" : 200,
"cls" : "NSHTTPURLResponse",
"url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22pn_other%22:%22Hello%20there%22,%22pn_apns%22:%7B%22aps%22:%7B%22alert%22:%22Hello%20there%22%7D%7D,%22pn_gcm%22:%7B%22data%22:%7B%22hello%22:%22there%22%7D%7D%7D?pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=serhii",
"url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%7B%22pn_other%22:%22Hello%20there%22,%22pn_apns%22:%7B%22aps%22:%7B%22alert%22:%22Hello%20there%22%7D%7D,%22pn_fcm%22:%7B%22data%22:%7B%22hello%22:%22there%22%7D%7D%7D?pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=serhii",
"headers" : {
"Access-Control-Allow-Methods" : "GET",
"Content-Type" : "text\/javascript; charset=\"UTF-8\"",
Expand Down Expand Up @@ -144,7 +144,7 @@
"id" : "B158F5C6-6DC1-4061-A0BE-23A9F63EC3A5",
"data" : {
"cls" : "NSData",
"base64" : "eyJ0Ijp7InQiOiIxNTc4MjcwMjgzMDg1OTkxMCIsInIiOjEyfSwibSI6W3siYSI6IjUiLCJmIjowLCJpIjoic2VyaGlpIiwicyI6MTcxLCJwIjp7InQiOiIxNTc4MjcwMjgzMDg2MDY5NyIsInIiOjEyfSwiayI6ImRlbW8iLCJjIjoidGVzdC1jaGFubmVsIiwiZCI6eyJwbl9vdGhlciI6IkhlbGxvIHRoZXJlIiwicG5fYXBucyI6eyJhcHMiOnsiYWxlcnQiOiJIZWxsbyB0aGVyZSJ9fSwicG5fZ2NtIjp7ImRhdGEiOnsiaGVsbG8iOiJ0aGVyZSJ9fX19XX0="
"base64" : "eyJ0Ijp7InQiOiIxNTc4MjcwMjgzMDg1OTkxMCIsInIiOjEyfSwibSI6W3siYSI6IjUiLCJmIjowLCJpIjoic2VyaGlpIiwicyI6MTcxLCJwIjp7InQiOiIxNTc4MjcwMjgzMDg2MDY5NyIsInIiOjEyfSwiayI6ImRlbW8iLCJjIjoidGVzdC1jaGFubmVsIiwiZCI6eyJwbl9vdGhlciI6IkhlbGxvIHRoZXJlIiwicG5fYXBucyI6eyJhcHMiOnsiYWxlcnQiOiJIZWxsbyB0aGVyZSJ9fSwicG5fZmNtIjp7ImRhdGEiOnsiaGVsbG8iOiJ0aGVyZSJ9fX19XX0="
},
"type" : 2
},
Expand Down Expand Up @@ -241,4 +241,4 @@
"id" : "C9847678-E76F-46C3-AF7D-61709EE079C7",
"type" : 4
}
]
]
4 changes: 2 additions & 2 deletions Tests/Tests/Integration/PNPublishIntegrationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ - (void)testItShouldPublishAndFetchEmptyHistoryWhenStoreInHistoryDisabled {
- (void)testItShouldPublishMobilePayloadWithWrappedKeys {
NSDictionary *mobilePayload = @{
@"apns": @{ @"aps": @{ @"alert": @"Hello there" } },
@"gcm": @{ @"data": @{ @"hello": @"there" } }
@"fcm": @{ @"data": @{ @"hello": @"there" } }
};
NSString *channel = [self channelWithName:@"test-channel"];
PubNub *client1 = [self createPubNubForUser:@"serhii"];
Expand All @@ -829,7 +829,7 @@ - (void)testItShouldPublishMobilePayloadWithWrappedKeys {
NSDictionary *expectedMessage = @{
@"pn_other": message,
@"pn_apns": mobilePayload[@"apns"],
@"pn_gcm": mobilePayload[@"gcm"]
@"pn_fcm": mobilePayload[@"fcm"]
};

[self subscribeClient:client2 toChannels:@[channel] withPresence:NO];
Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests/Unit/Helpers/PNNotificationPayloadBuilderTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ - (void)testItShouldProvidePayloadForAPNSAndFCMWhenCalledWithAPNSAndFCMPushTypes
}
}
},
@"pn_gcm": @{
@"pn_fcm": @{
@"notification": @{
@"title": expectedTitle,
@"body": expectedBody
Expand Down Expand Up @@ -179,7 +179,7 @@ - (void)testItShouldProvidePayloadForAPNS2AndFCMWhenCalledWithAPNSAndFCMPushType
}
]
},
@"pn_gcm": @{
@"pn_fcm": @{
@"notification": @{
@"title": expectedTitle,
@"body": expectedBody
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.1
5.5.0

0 comments on commit 70eabd3

Please sign in to comment.