From 04f5aba803f077167c0e36f4f084a5fb5f727631 Mon Sep 17 00:00:00 2001 From: Newton Filho Date: Sun, 21 Jul 2024 17:15:06 +0100 Subject: [PATCH 1/3] Update README.md Adjustments on the Example class --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e5e44cd8..3e1f5672 100644 --- a/README.md +++ b/README.md @@ -81,11 +81,14 @@ Please follow the [installation](#installation) instruction and execute the foll ```java // Import classes: +import java.util.Arrays; import com.onesignal.client.ApiClient; import com.onesignal.client.ApiException; import com.onesignal.client.Configuration; import com.onesignal.client.auth.*; -import com.onesignal.client.models.*; +import com.onesignal.client.model.CreateNotificationSuccessResponse; +import com.onesignal.client.model.Notification; +import com.onesignal.client.model.StringMap; import com.onesignal.client.api.DefaultApi; public class Example { @@ -106,14 +109,14 @@ public class Example { return notification; } - public static void main(String[] args) { + public static void main(String[] args) throws ApiException { // Setting up the client ApiClient defaultClient = Configuration.getDefaultApiClient(); HttpBearerAuth appKey = (HttpBearerAuth) defaultClient.getAuthentication("app_key"); appKey.setBearerToken(appKeyToken); HttpBearerAuth userKey = (HttpBearerAuth) defaultClient.getAuthentication("user_key"); userKey.setBearerToken(userKeyToken); - api = new DefaultApi(defaultClient); + DefaultApi api = new DefaultApi(defaultClient); // Setting up the notification Notification notification = createNotification(); @@ -122,7 +125,7 @@ public class Example { CreateNotificationSuccessResponse response = api.createNotification(notification); // Checking the result - System.out.print(response.getId(); + System.out.print(response.getId()); } } From 3602c08ccdb8707e2d4d0d88567cf9022fd08330 Mon Sep 17 00:00:00 2001 From: Newton Filho Date: Sun, 21 Jul 2024 17:16:41 +0100 Subject: [PATCH 2/3] Update README.md Add first the example to clone repo --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3e1f5672..8af2e15b 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,12 @@ Building the API client library requires: ## Installation +First, clone the repo, simply execute: + +```shell +git clone https://github.com/OneSignal/onesignal-java-api.git +``` + To install the API client library to your local Maven repository, simply execute: ```shell From 98010ca7c57318c8aaa8997d03074271640b990e Mon Sep 17 00:00:00 2001 From: Newton Filho Date: Sun, 21 Jul 2024 17:18:20 +0100 Subject: [PATCH 3/3] Update README.md Better clarify instructions to Maven users --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8af2e15b..5de8d062 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) f ### Maven users -Add this dependency to your project's POM: +After you build and install to your local Maven repo ou deploy to the project repository, add this dependency to your project's POM: ```xml