Skip to content

Commit ed240db

Browse files
authored
Rebranding for Notifications-v2 plugin (#207)
1 parent 49e29e4 commit ed240db

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

markdown/plugin/notifications-v2/index.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ application =
109109

110110
Additionally, if you want to use Google <nobr>[Firebase](https://firebase.google.com) Cloud Messaging (FCM)</nobr> for push notifications, follow these steps:
111111

112-
1. Copy `GoogleService-Info.plist`, provided in the Firebase console, to your Corona project's root directory alongside `main.lua`.
112+
1. Copy `GoogleService-Info.plist`, provided in the Firebase console, to your CORONA_CORE_PRODUCT project's root directory alongside `main.lua`.
113113

114114
2. Add the following entries to the <nobr>`iphone` &rarr; `plist`</nobr> table of `build.settings`:
115115

@@ -135,7 +135,7 @@ settings =
135135

136136
If your app is for Android, you must follow these additional steps to ensure that Firebase notifications function properly:
137137

138-
1. Copy <nobr>`google-services.json`</nobr>, provided in the Firebase console, to your Corona project's root directory alongside `main.lua`.
138+
1. Copy <nobr>`google-services.json`</nobr>, provided in the Firebase console, to your CORONA_CORE_PRODUCT project's root directory alongside `main.lua`.
139139

140140
2. Add an additional `useGoogleServicesJson` entry into the `android` table of `build.settings`. When added, the build server will read the settings from the JSON file and integrate them into your app during the build phase.
141141

@@ -168,15 +168,15 @@ If you're using CORONA_NATIVE_PRODUCT for iOS, you'll need to add a reference to
168168

169169
When developing natively for Android, Google wants all icons in the project's `res` directory. This is important because Google's Android build process generates code, creating a `R.java` file containing unique integer IDs to every resource that your project and its libraries contain. The IDs are needed to access these resources, including the notification icons.
170170

171-
When developing with CORONA_NATIVE_PRODUCT, you must override Corona's notification icon resources as follows:
171+
When developing with CORONA_NATIVE_PRODUCT, you must override notification icon resources as follows:
172172

173173
1. First, you should become familiar with how Android handles resources by reading Google's official [documentation](http://developer.android.com/guide/topics/resources/overview.html).
174174

175-
2. Inspect the Corona library's resource directory (`./Native/Corona/android/lib/Corona/res/`). In this directory, every `drawable` directory contains a file named `corona_statusbar_icon_default.png`. This is the image file to override. Note that this action should be an "override" and __not__ a replacement&nbsp;&mdash; you should __not__ modify the contents of the Corona library directory!
175+
2. Inspect the CORONA_CORE_PRODUCT library's resource directory (`./Native/Corona/android/lib/Corona/res/`). In this directory, every `drawable` directory contains a file named `corona_statusbar_icon_default.png`. This is the image file to override. Note that this action should be an "override" and __not__ a replacement&nbsp;&mdash; you should __not__ modify the contents of the CORONA_CORE_PRODUCT library directory!
176176

177177
3. To override these notification image files with your own, you need to set up the Android project with the same `drawable` directories under your `res` directory. Add each `IconNotification*.png` icon to its respective `drawable` directory by resolution and version <nobr>(see [here][guide.events.appNotification#android-icons])</nobr>. You also __must__ rename these files to `corona_statusbar_icon_default.png`.
178178

179-
4. Make a small change to the `copyCoronaResources` task of <nobr>`build.gradle` (`Module: app`)</nobr> to ignore the notification icons provided in the Corona library project. Do this by replacing the <nobr>`from fileTree(...)`</nobr> line with the following:
179+
4. Make a small change to the `copyCoronaResources` task of <nobr>`build.gradle` (`Module: app`)</nobr> to ignore the notification icons provided in the CORONA_CORE_PRODUCT library project. Do this by replacing the <nobr>`from fileTree(...)`</nobr> line with the following:
180180

181181
<div class="code-indent">
182182

markdown/plugin/notifications-v2/scheduleNotification.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Scheduling a notification upon application suspend can cause the application to
2525

2626
### Android
2727

28-
Unlike iOS, local notifications on Android are managed by the application and not by the operating system. This means that all scheduled notifications and status bar notifications will be cleared when the application process terminates. However, pressing the __Back__ key to exit the application window will not terminate the application process&nbsp;&mdash; this only destroys the application window which runs your project's Lua scripts and it will receive the `"applicationExit"` [system][api.event.system.type] event just before being destroyed. Thus, the application process will continue to run in the background&nbsp;&mdash; this is standard Android application behavior which allows its notifications to remain available. If the application process gets fully terminated, Corona will automatically restore all pending notifications when the application restarts.
28+
Unlike iOS, local notifications on Android are managed by the application and not by the operating system. This means that all scheduled notifications and status bar notifications will be cleared when the application process terminates. However, pressing the __Back__ key to exit the application window will not terminate the application process&nbsp;&mdash; this only destroys the application window which runs your project's Lua scripts and it will receive the `"applicationExit"` [system][api.event.system.type] event just before being destroyed. Thus, the application process will continue to run in the background&nbsp;&mdash; this is standard Android application behavior which allows its notifications to remain available. If the application process gets fully terminated, CORONA_CORE_PRODUCT will automatically restore all pending notifications when the application restarts.
2929

3030
This said, calling [os.exit()][api.library.os.exit] will terminate the application process and __clear__ all notifications. If you need to close just the application window, call [native.requestExit()][api.library.native.requestExit] which only exits the application window and keeps the application process alive, thus keeping your notifications alive.
3131

0 commit comments

Comments
 (0)