Skip to content

Commit 1fbc49c

Browse files
authored
Updated the Readme to address code review feedback
1 parent 5821a50 commit 1fbc49c

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

packages/messaging/README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ npm install @adobe/react-native-aepmessaging
2525
```
2626

2727
**Podfile setup**
28-
The In app Message APIs dependes on the AEP Messaging 1.1.0. This version is not yet published to the Cocoapods but is available in the public [github repository](https://github.com/adobe/aepsdk-messaging-ios/tree/staging). Add the following pod dependency in your applications Podfile under the application target.
28+
The In app Message APIs depends on the AEP Messaging, v1.1.0. This version is not yet published to the Cocoapods but is available in the public [github repository](https://github.com/adobe/aepsdk-messaging-ios/tree/staging). Add the following pod dependency in your applications Podfile under the application target.
2929

3030
```Ruby
3131
target 'AEPSampleApp' do
@@ -134,17 +134,17 @@ Handling push notifications must be done in native (Android/iOS) code for the Re
134134
- [Apple - iOS push notification setup](https://developer.apple.com/documentation/usernotifications/registering_your_app_with_apns)
135135
- [Google - Android push notification setup](https://firebase.google.com/docs/cloud-messaging/android/client)
136136

137-
## Push Message API usage
138-
Push Mesage related APIs in the Messaging SDK must be called from the native Android/iOS project of React Native app.
137+
## Push Messaging APIs usage
138+
Push messaging APIs in the SDK must be called from the native Android/iOS project of React Native app.
139139

140140
###### [iOS API usage](https://github.com/adobe/aepsdk-messaging-ios/blob/main/Documentation/APIUsage.md)
141141

142142
##### [Android API usage](https://github.com/adobe/aepsdk-messaging-android/blob/main/Documentation/APIUsage.md)
143143
In Android, [MessagingPushPayload](https://github.com/adobe/aepsdk-messaging-android/blob/main/Documentation/push/MessagingPushPayload.md#messagingpushpayload-usage) can be used for getting the notification attributes like title, body, and action. These are useful for push notification creation.
144144

145-
## In App Messages API reference
145+
## In-app messages API reference
146146
### refreshInAppMessages
147-
Initiates a network call to retrieve remote In-App Message definitions.
147+
Initiates a network call to retrieve remote in-app message definitions.
148148

149149
**Syntax**
150150
```javascript
@@ -157,7 +157,7 @@ Messaging.refreshInAppMessages();
157157
```
158158

159159
### setMessagingDelegate
160-
Sets the UI Message delegate to listen the Message lifecycle events.
160+
Sets the MessagingDelegate in AEPCore to listen the Message lifecycle events.
161161

162162
**Syntax**
163163
```javascript
@@ -189,7 +189,7 @@ const messagingDelegate = {
189189
```
190190

191191
### saveMessage
192-
Call to the saveMessage leads to in-memory caching of the Message object. Cached Message object can be later use to show message. This function should be called from **shouldShowMessage** of MessagingDelegate.
192+
Natively caches the provided Message object in-memory. Cached Message object can be later use to show message or perform other actions on the Message object. This function should be called from **shouldShowMessage** of MessagingDelegate.
193193

194194
**Syntax**
195195
```javascript
@@ -276,19 +276,19 @@ var message: Message;
276276
message.setAutoTrack(true);
277277
```
278278
279-
### clearMessage
279+
### clear
280280
Clears the reference to the in-memory cached Message object. This function must be called if a Message was saved by calling "Messaging.saveMessage" but no longer needed. Failure to call this function leads to memory leaks.
281281
282282
283283
**Syntax**
284284
```javascript
285-
clearMessage();
285+
clear();
286286
```
287287
288288
**Example**
289289
```javascript
290290
var message: Message;
291-
message.clearMessage();
291+
message.clear();
292292
```
293293
294294
## Programatically control the display of in-app messages
@@ -307,7 +307,7 @@ type MessagingDelegate = {
307307
urlLoaded(url: string, message: Message): void;
308308
};
309309
```
310-
Object of type MessagingDelegate can be create as shown below:
310+
Objects of type MessagingDelegate can be created as shown below:
311311
```javascript
312312
const messagingDelegate = {
313313

@@ -343,22 +343,22 @@ function shouldShowMessage(message: Message): boolean {
343343
}
344344
```
345345
346-
Another option for the developer is to store a reference to the Message object, and call the show() method on it at a later time. App developer also have to call _Messaging.saveMessage(message)_ from _shouldShowMessage_ for caching the Message on the native side of the RN package.
346+
Another option for the developer is to store a reference to the Message object, and call the show() function on it at a later time. App developer also have to call _Messaging.saveMessage(message)_ from _shouldShowMessage_ of MessagingDelegate for caching the Message on the native side of the RN AEPMessaging package.
347347
Continuing with the above example, the developer has stored the message that was triggered initially, and chooses to show it upon completion of the other workflow:
348348
349349
```javascript
350-
var currentMessage: Message;
350+
var cachedMessage: Message;
351351

352352
function otherWorkflowFinished() {
353353
anotherWorkflowStatus = "complete";
354-
currentMessage.show();
354+
cachedMessage.show();
355355
}
356356

357357
function shouldShowMessage(message: Message): boolean {
358-
if(someOtherWorkflowStatus == "inProgress") {
358+
if(anotherWorkflowStatus === "inProgress") {
359359
// store the current message for later use
360360
Messaging.saveMessage(message);
361-
currentMessage = message;
361+
cachedMessage = message;
362362
return false
363363
}
364364

0 commit comments

Comments
 (0)