New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push notifications isn´t working #1
Comments
First of all sorry for my English but I speak Spanish as my native language. So I decide to start a new project called Snappy. As u know notifications are not working, so we start solving this bug and here are the steps to make it work. With this fix recent activities screen and notification ballon counter will start working. Of course the chats will reload automatically. I should clarify that this fix does not solve the problem that notifications are not shown in status bar (i`m working on this) So let's start IOS PUSH NOTIFICATIONS SETUP GOOGLE CLOUD MESSAGING SETUP (ANDROID) BACKEND MODIFICATIONS (thanks to sbhaskar for his help) 1-Replace "sendMessageToUser" method to this one on file src/Spika/Controllers/MessageController.php from line 165. $controllers->post('/sendMessageToUser',
2-Add this new method on file src/Spika/Controllers/MessageController.php function generatePushNotificationMessage($fromUser,$toUser){
} 3-Save and restart your server. Notifications are now working. Good Luck! |
Did u follow the instructions? |
I will upload the project on weekend! |
thank you! update here when you upload? :) |
Please send modified " MessageController.php" to my gmail account - kiranalright@gmail.com |
With this the Push notifications inside chat is working ? |
Could you please privide the full source code of MessageController.php ? |
I'm stuck...
|
Hello Bafplus, i will upload the code soon with the changes described above. Are u using linux as your backend server? Push notifications working at 100% are not so simple to implement, I'm working on it, but this requires changes over 7 different files and changes are not ready yet. Similarly if anyone has developed a new feature you want to share, I'd like to see it. |
For now, u need to check AsyncTaskController.php in your server and change the validation for localhost and set your server public ip address |
Hy @jaullo , thanks for the reply and you're great work so far. I'm a newby on android development so at this point i need point to point instructions. I was hoping that Spika would "work" that way, sadly it didnt so i'm very glad i found you're project. I figured to getting the push working you "only" have to setup the api key and put them in the according files since the code was already implemented...guess that is not the case. Having it working thus far is great already! Many kuddo's to you. If we can manage to get the google push working also then i am 100% sattisfied! I will be keeping my eye out at this project and if i can help in any way, please let me know. FYI, running server on Ubuntu 14.10 server. |
Hello people and good night! This version is fully functionally. Howhever the push notifications isn't working, we found that the problem is from server side. If some one wants to help me with development or be a tester. Please let me know. Thanks |
Hy Jaullo, |
Jaullo, Why not also put the server files on Ghithub? |
The reason push notifications fail is the $apiKey actually has no key. Also, the gcm message configuration in broken. Replace the sendGCM in PushNotificationProvider.php with this function sendGCM($apiKey, $json, $app = null) {
Don't make any other changes. |
Works with the original Spika project. Haven't tried it with this. |
so @nikhil93uf without anychanges provided by @jaullo in this(snappy), only changing the PushNotificationProvider.php will fix the whole issue of no push notifications? |
Yes. Remember to update your API key in the sendGCM function of the new PushNotificationProvider |
What Type of key? Browser, server or android appliciation? |
The browser and server key types, both work. |
Replace with the key. Van: naveedrocks1 [mailto:notifications@github.com] do i need to replace GCM_API_Key with my browser api key? — |
Not the GCM_API_Key. In the new PushNotificationProvider, insert your api key where I marked |
So the api key in Init.php is depricated? Van: nikhil93uf [mailto:notifications@github.com] Not the GCM_API_Key. In the new PushNotificationProvider, insert your api key where I marked — |
Yes. Until I can figure out why the $apikey passed to the sendGCM is not set correctly. For now, it is deprecated. |
hmmm...i have reinstalled the server, changed the pushnotificationprovider but still nothing changes. Tried it with the original spikaapp and with my own. Tried the server and browser key. When i log in to dev google i also see no api hits....what am i doing wrong here? I'm no coder. Any change someone is willing to check my server setup? |
Hello @naveedrocks1, @sureshvaavel and @bafplus there is no need to change Have proven my code? Maybe in future (because is so expensive) i could setup a VPS on linux. |
Also, in the pushnotificationprovider, there is a condition that checks if the server is not 'localhost' then return an error @jaullo I don't know about your implementation, but I was talking about the original code. In any case I made a few changes to the code again. You can try the new code here. The reason it wasn't working was the original code automatically returned an error if the server ip was NOT 'localhost'. Pretty unwarranted exit condition |
Yes. That code (the validation) needs to be adjusted to match your server. |
@nikhil93uf Tried youre code but no succes... |
Thanks jaullo, you saved my life! :) |
Hello @flavio66 , |
Push notificacions for thw new snappy version was fixed |
Push notifications are not working on android or IOS.
The text was updated successfully, but these errors were encountered: