I'm having an issue receiving push notifications on android devices
Steps I followed:
Opened the app in my device (android) and subscribed for the Push Notification
a. Used form authentication (using j_security_check)
b. Provided a mobile number as username
Invoked the adapter's submit notification function.
a. Got response saying the Push Notification is sent to the user
But no Push Notification appearing on device (android). Tried on couple of devices (android), but having same issue.
How can I debug the issue or what am I doing wrong here.
P.S I have the sample Push application working fine. But on integration with my application it's not working. Only the difference is the login page
Sample Push App login page
<form id="loginForm" >
<input type="text" id="usernameInputField" placeholder="Username"/><br />
<input type="password" id="passwordInputField" placeholder="Password"/><br/>
<input type="button" id="loginButton" value="Login" />
</form>
Button Bind Code
$('#loginButton').bind('click', function () {
var reqURL = '/j_security_check';
var options = {};
options.parameters = {
j_username : $('#usernameInputField').val(),
j_password : $('#passwordInputField').val()
};
options.headers = {};
pushAppRealmChallengeHandler.submitLoginForm(reqURL, options, pushAppRealmChallengeHandler.submitLoginFormCallback);
});
My App login page
<span class="fields">
<input type="text" data-role="none" placeholder="Mobile Number" class="input_text" id="mobnum"/>
<input type="text" data-role="none" placeholder="Name" class="input_text" id="name"/>
<input type="text" data-role="none" placeholder="Email ID" class="input_text" id="email"/>
<input type="text" data-role="none" placeholder="Organization" class="input_text" id="org"/>
<span class="next_button"><a href="#" data-role="none" id="nxt_btn2"></a></span>
</span>
Button Bind Code
$('#nxt_btn2').bind('click', function () {
var reqURL = '/j_security_check';
var options = {};
options.parameters = {
j_username : $('#mobnum').val(),
j_password : $('#email').val()
};
options.headers = {};
pushAppRealmChallengeHandler.submitLoginForm(reqURL, options, pushAppRealmChallengeHandler.submitLoginFormCallback);
});
The Google Cloud Messaging for Android was not enabled. So I was getting subscribed and messages were being sent form MobileFirst server to GCM but since the API was not enabled in GCM I was not getting the notfications on my device.
Steps Taken
Special thanks to @kawineshSK and IdanAdar