UNPKG

4.32 kBMarkdownView Raw
1# ISSUES
2
3- [Read the docs](#read-the-docs)
4- [Search the issues](#search-the-issues)
5- [Opening a new issue](#opening-a-new-issue)
6 - [Provide details](#provide-details)
7 - [An example issue](#an-example-issue)
8- [Voting on an issue](#voting-on-an-issue)
9
10The following tips are for users of this plugin who want to get help.
11
12## Read the docs
13
14I'll be the first to admit that the docs are not perfect but start here at the [README](https://github.com/phonegap/phonegap-plugin-push/blob/master/README.md) to see if your problem is documented. If it isn't continue on but if you do get an answer then consider sending a documentation pull request.
15
16## Search the issues
17
18Your question may have already been answered. Make sure you search at least the repo's [issues](https://github.com/phonegap/phonegap-plugin-push/issues) before you create a new one.
19
20## Opening a new issue
21
22If you have searched the issues and haven't found anything that resembles your problem then follow these guidelines in creating a new issue.
23
24### Provide details
25
26Give as many details as possible. Issues without many details will be more difficult to debug and will encounter delays.
27
28Select a concise, informative title for the issue. Here's a good article on writing [subject lines](https://www.nngroup.com/articles/microcontent-how-to-write-headlines-page-titles-and-subject-lines/).
29
30Include the following at a minimum:
31_ what version number of plugin are you using?
32- which platform and version you are testing on? iOS 9.0, Android 5.0, etc.
33- a detailed description of your problem. Including:
34 - steps to reproduce
35 - expected result
36 - actual result
37- how you are sending the push data to the device, including an example payload
38
39You may also want to include:
40- some sample code that illustrates the problem.
41- logs taken while the problem was reproduced.
42- screenshots!
43
44If the code or logs are huge, let's say over 20 lines please think about using a web service like [Gist](https://gist.github.com/) or [Pastebin](http://pastebin.com/).
45
46### An example issue
47
48**The wrong way**
49
50*Title:* This plugin does not work for me
51
52*Details:* Please fix quickly as my business depends on this plugin.
53
54**The right way**
55
56*Title:* Registration event never received on Samsung Galaxy S running Android 2.3
57
58*Details:* I'm using version 1.5.2 of this plugin on my Samsung Galaxy S5 device which runs Android 4.4. I never receiving the `registration` event in my application when I expect it to return a value I can send to my push service.
59
60You can see the code I'm using in this gist: [https://gist.github.com/macdonst/191f74ac75b6802c047d](https://gist.github.com/macdonst/191f74ac75b6802c047d)
61
62And an output of the logs when trying to run the app are in this gist: [https://gist.github.com/macdonst/47549150c299080c455c](https://gist.github.com/macdonst/47549150c299080c455c)
63
64Please point me in the right direction.
65
66*Response:*
67
68Thanks for the detailed logs and example code by looking them over I'm sure of what your problem is. If you look at line [334](https://gist.github.com/macdonst/47549150c299080c455c#file-logcat-txt-L334) of your logcat you will see that it complains that:
69
70```
71I/chromium(11669): [INFO:CONSOLE(54)] "Uncaught ReferenceError: PushNotification is not defined", source: file:///android_asset/www/js/index.js (54)
72```
73
74This leads me to line [4](https://gist.github.com/macdonst/191f74ac75b6802c047d#file-app-js-L4) of your code where you are initializing push before you get the `deviceready` event. Like all Cordova API's you have to wait until you receive the `deviceready` event before you initialize Push.
75
76Check out [https://github.com/phonegap/phonegap-plugin-push/blob/20f489a90cf519f962fd957700f92115f142594b/example/www/js/index.js](https://github.com/phonegap/phonegap-plugin-push/blob/20f489a90cf519f962fd957700f92115f142594b/example/www/js/index.js) for an example of how to wait for `deviceready`.
77
78## Voting on an issue
79
80Did you know you can vote on issues in the phonegap-plugin-push repository? If you install the [ZenHub](https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd) Chrome Extension you will be able to +1 issues to indicate how popular they are to the community. It's a way better way for the contributors to keep track of important issues.