Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
📝 Fix PAYLOAD.md regarding "drawable" directory name (#1711)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianpaj authored and macdonst committed May 8, 2017
1 parent cfad83f commit a27a62d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/PAYLOAD.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ var push = PushNotification.init({
});
```

Where *icon* is the name of an image in the Android *drawables* folder. Writing a hook to describe how to copy an image to the Android *drawables* folder is out of scope for this README but there is an [excellent tutorial](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) that you can copy.
Where *icon* is the name of an `.png` image file in the Android `res/drawable` folder. For example: `platforms/android/res/drawable/phonegap.png`
Writing a hook to describe how to copy an image to the Android `res/drawable` folder is out of scope for this README but there is an [excellent tutorial](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) that you dcan copydd

*iconColor* is one of the supported formats #RRGGBB or #AARRGGBB or one of the following names: 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'. *iconColor* is supported on Android 5.0 and greater.

Expand All @@ -243,14 +244,14 @@ Please follow the [Android icon design guidelines](https://www.google.com/design

Additionally, each push can include a large icon which is used to personalize each push. The location of the image may one of three types.

The first is the *drawables* folder in your app. This JSON sent from GCM:
The first is the `res/drawable` folder in your app. This JSON sent from GCM:

```javascript
{
"registration_ids": ["my device id"],
"data": {
"title": "Large Icon",
"message": "Loaded from drawables folder",
"message": "Loaded from drawable folder",
"image": "twitter"
}
}
Expand All @@ -266,15 +267,15 @@ var deviceID = "my device id";
var service = new gcm.Sender(apiKey);
var message = new gcm.Message();
message.addData('title', 'Large Icon');
message.addData('message', 'Loaded from drawables folder.');
message.addData('message', 'Loaded from drawable folder.');
message.addData('image', 'twitter');
service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) {
if(err) console.error(err);
else console.log(response);
});
```

Would look for the *twitter* image in the drawables folder and produce the following notification.
Would look for the *twitter* image in the `res/drawable` folder and produce the following notification.

![2015-07-24 02 34 41](https://cloud.githubusercontent.com/assets/353180/8866903/2df48028-3190-11e5-8176-fe8b3f7c5aab.png)

Expand Down Expand Up @@ -309,7 +310,7 @@ service.send(message, { registrationTokens: [ deviceID ] }, function (err, respo
});
```

Would look for the *logo.png* file in the assets/www/img folder. Since your apps www folder gets copied into the Android assets folder it is an excellent spot to store the images without needing to write a hook to copy them to the *drawables* folder. It produces the following notification.
Would look for the *logo.png* file in the assets/www/img folder. Since your apps www folder gets copied into the Android assets folder it is an excellent spot to store the images without needing to write a hook to copy them to the `res/drawable` folder. It produces the following notification.

![2015-07-24 02 20 02](https://cloud.githubusercontent.com/assets/353180/8866901/2df19052-3190-11e5-8c16-a355c59209f3.png)

Expand Down

0 comments on commit a27a62d

Please sign in to comment.