Skip to content

Commit 02c7322

Browse files
Merge pull request #2 from neptune-software/feature/supportABAPSDKforGoogleCloud1.7
Compatibility with ABAP SDK for Google Cloud Version 1.7
2 parents c3fd3b8 + 1de8f2b commit 02c7322

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@ This is an additional integration scenario for the amazing Google ABAP SDK Libra
55
The main purpose of this library is to allow sending Firebase Push Notifications (aka Firebase Cloud Messaging) via the new HTTP v1 API (https://fcm.googleapis.com/v1/projects/*myproject-b5ae1*/messages:send) as the legacy FCM API (https://fcm.googleapis.com/fcm/send) was deprecated on June 20, 2023, and will be removed in June 2024. You find more information about the deprecation and migration steps [here](https://firebase.google.com/docs/cloud-messaging/migrate-v1).
66
The biggest challenge for the new API is that the authentication takes place through short-lived OAuth access tokens that need to be obtained before sending the actual request. The main ABAP Cloud Library already has all implementation for the correct handling of tokens in place that's why we choose to have the main Google Cloud ABAP SDK as a foundation for this additional functionality.
77

8-
So please make sure you **FIRST INSTALL AND SETUP THE GOOGLE CLOUD ABAP SDK IN VERSION 1.5** (see [Prerequisites](#Prerequisites)) before using this package because you would get syntax errors otherwise.
8+
So please make sure you **FIRST INSTALL AND SETUP THE GOOGLE CLOUD ABAP SDK** (see [Prerequisites](#Prerequisites)) before using this package because you would get syntax errors otherwise.
9+
10+
## Version Dependency
11+
Depending on the **GOOGLE CLOUD ABAP SDK Version** you need to install different versions of this repository.
12+
13+
If you are using **GOOGLE CLOUD ABAP SDK 1.5** please install Version 1.0 of this Repository (https://github.com/neptune-software/google-abap-sdk/releases/tag/v1.0.0).
14+
15+
If you are using **GOOGLE CLOUD ABAP SDK 1.7** please install Version 2.0 of this Repository (https://github.com/neptune-software/google-abap-sdk/releases/tag/v2.0.0).
16+
17+
If you don't ensure to download the correct version you will get a syntax error that is also easily fixable on your own if you want (see https://github.com/neptune-software/google-abap-sdk/commit/9e1cf05d7b9cc622386a546295f574f5eb93eb25)
918

1019
## Background
1120
The Neptune DXP allows you to create Mobile Clients both for Android and iOS via the Cordova framework. Our solution offers an easy way to integrate Firebase Cloud Messaging (Push Notifications via Firebase) into your Mobile Clients by configuring a few parameters in our Cockpit. Our Neptune DXP SAP Edition is an ABAP Addon that comes with the Function Module called /NEPTUNE/PUSH_FIREBASE. It allows you to send push notifications to the corresponding Mobile Clients. However, since this function module is using the legacy FCM API, this new repository leveraging the well-established Google Cloud ABAP SDK is the easy-to-use successor of the /NEPTUNE/PUSH_FIREBASE function module.
1221

1322
In addition to the Neptune DXP integration, you can also use this library for general-purpose Firebase Cloud Messaging scenarios outside a Neptune DXP use case.
1423

1524
## Prerequisites
16-
Before using this library you need to install the [Cloud ABAP SDK version 1.5](https://cloud.google.com/solutions/sap/docs/abap-sdk/latest/all-guides). It comes with a very detailed install and setup guide so please follow that upfront. After you install the corresponding transport (at least the "Token" approach is required. The additional OAuth transport can be installed but is not required) you need to set up the general authentication settings that are mentioned in the documentation that will then later be used for this FCM library.
25+
Before using this library you need to install the correct [Cloud ABAP SDK version](https://cloud.google.com/solutions/sap/docs/abap-sdk/latest/all-guides). It comes with a very detailed install and setup guide so please follow that upfront. After you install the corresponding transport (at least the "Token" approach is required. The additional OAuth transport can be installed but is not required) you need to set up the general authentication settings that are mentioned in the documentation that will then later be used for this FCM library.
1726

1827
## Artifacts
1928
This package comes with a class (ZCL_GOOG_FCM_V1) that implements the calling of the new HTTP v1 API via the following public methods.

deps/#goog#cl_http_client.clas.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ data GV_PROJECT_ID type string .
4141
methods CLOSE_HTTP_CLIENT .
4242
methods CONSTRUCTOR
4343
importing
44-
!IS_KEY type /GOOG/CLIENT_KEY optional
44+
!IV_KEY type CLIKE optional
4545
!IV_ENDPOINT type STRING optional
4646
!IV_ENDPOINT_SUFFIX type STRING optional
4747
!IV_SERVICE_NAME type /GOOG/SERVICE_NAME optional

src/zgoog_client/zcl_goog_fcm_v1.clas.abap

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public section.
141141
end of ty_messages_send_each_for_mc .
142142

143143
constants C_SERVICE_NAME type /GOOG/SERVICE_NAME value 'fcm:v1'. "#EC NOTEXT
144-
constants C_REVISION_DATE type DATUM value 20240321. "#EC NOTEXT "#EC NEEDED
145-
constants C_SUPPORTED_AUTH type /GOOG/SUPP_AUTH value 'IJIJ'. "#EC NOTEXT "#EC NEEDED
144+
constants C_REVISION_DATE type DATUM value 20240321. "#EC NOTEXT "#EC NEEDED
145+
constants C_SUPPORTED_AUTH type /GOOG/SUPP_AUTH value 'IJIJ'. "#EC NOTEXT "#EC NEEDED
146146
constants C_ROOT_URL type STRING value 'https://fcm.googleapis.com'. "#EC NOTEXT
147147
constants C_PATH_PREFIX type STRING value ''. "#EC NOTEXT
148148

@@ -197,8 +197,8 @@ method close.
197197
endmethod.
198198

199199

200-
method CONSTRUCTOR.
201-
data: lv_err_text type string,
200+
method constructor.
201+
data: lv_err_text type string,
202202
lv_endpoint type string,
203203
lv_endpoint_suffix type string.
204204

@@ -214,7 +214,8 @@ method CONSTRUCTOR.
214214
lv_endpoint = c_root_url.
215215
lv_endpoint_suffix = c_path_prefix.
216216

217-
super->constructor( is_key = ls_key
217+
super->constructor( "is_key = ls_key "#1
218+
iv_key = iv_key_name "#1
218219
iv_endpoint = lv_endpoint
219220
iv_endpoint_suffix = lv_endpoint_suffix
220221
iv_service_name = c_service_name

0 commit comments

Comments
 (0)