-
Notifications
You must be signed in to change notification settings - Fork 60
Message Notification #78
Comments
No way. I just don't know how to do it. Facebook Mobile website has no message notifications in its notification feed. I'm using a feed because it's reliable and simple. But my app is open-source. If someone could help me it would be easier to make this feature. |
Maybe it would be possible to scrap messages URL to get all data needed.
|
I was thinking about message notifications. Please, take a look at this C++ project https://github.com/MartinBriza/gFB (I had to install QT-Creator to compile it). That program shows you when your contacts are online and offline and messages received, among other things. We can translate it from C++ to Java, and drop the things not needed. We just need to parse the messages received and show a notification. When the user press the notification it will display FaceSlim, so the user can chat from there. |
I can help with this 👍 |
Awesome news!
|
Message notifications will work with this, https://gist.github.com/creativetrendsapps/39ee0a94a0409b4fd21f :). |
Awesome news! I will add this soon (next week). sob., 2.01.2016, 08:20 Jorell Rutledge użytkownik [email protected]
|
You can also do the same with notifications to avoid having the user getting redirected to get their RSS feed. The method used in Folio for Facebook, still grabs their RSS feed. It's based on the cookie manager though and an element from the Facebook SDK. I can share that with you as well if you'd like. |
If you could publish a code snippet it would be great. I'm just curious. I sob., 2.01.2016, 15:05 Jorell Rutledge użytkownik [email protected]
|
https://gist.github.com/creativetrendsapps/0e6303daf9dc95978b35 With this you are still getting the notifications directly from a Facebook notification. The user just doesn't need to be redirected to get their RSS feed URL. If you would like to see a working example download Folio for Facebook from the Play Store. This is how I'm getting notifications. |
Well. Thanks a lot :) I'm changing it. Awesome job, dude. I'm gonna add you sob., 2.01.2016, 16:24 Jorell Rutledge użytkownik [email protected]
|
You're welcome :-). You're app has helped me so, it's the least I can do :-). |
The only thing I'm missing is Could you publish it somewhere? |
Sure. Give me a sec. |
Thanks. It seems to be just one constant with the value "href" so the class is not really needed. Ok, let's find out whether it is working. Everything is modified now to use your solution. |
Lets see :-). |
Finally. It needs a lot of testing but should be good. Or just pull request and write whatever you want. Thanks a lot again! |
Just put Creative Trends :-). I'm happy I could help! |
Awesome. Just a quick update - notifications work! I'm not sure about message notifications, too late to write to someone but it probably works too :D |
That's great! Again, I'm happy I could help. You've made a really great app! |
Great news ! @creativetrendsapps you rock ! |
👍 |
I've compiled latest code, notifications don't work at all. |
Yes. There is a problem with mobile data. I'm guessing user agent is not It uses too much data too. I'm going to restore the previous "get feed" Data efficient, semi-automatic is better than the current solution. I need pon., 4.01.2016, 16:31 Mladen Pejaković użytkownik [email protected]
|
It's working now! Please test it if you want :) I'm not sure about data usage. It may be higher. It's higher for sure. I'm not sure by how much yet. EDIT Oh. I've already said this before. I'm repeating myself. I need more sleep ;) I will leave notifications activated for the whole night and I will do some math in the morning. I hope a weekly data usage for 15 minute interval will be acceptable. We can discuss it later. I don't really care how much data I'm using but this app have to be "Slim". |
I compiled the app yesterday, and get notifications for both messages and
|
@pejakm thanks for the crash report. Sorry about crash :) |
Still no Facebook notifications, sorry. :( |
@pejakm don't worry. I will add a log saver soon to finally locate your issue. |
Please test notifications with file logging enabled. Logs are saved to [sdcard]/FaceSlim.log |
|
I can access https://web.facebook.com/notifications in my browser just fine. |
I've also tried using "https://m.facebook.com/notifications" for the |
Well. Both urls don't work. It's so strange. I will add user agent logging because user agent seems to be the problem here. At least one url should work, depending on your connection type. At least now we know what is exactly the problem - feed url cannot be generated. @creativetrendsapps what notifications url are you using in your app? Has someone any ideas? My logs:
|
I've changed user agent to match my phone browser's (Lightning Browser). Still the same error. Anything else I can do to find out why "URL error" is happening? |
I have no idea. But I'm thinking all the time. I will try to use the webview's user agent, because it's where we are logged in to Facebook. It may fix it. Every MainActivity start this string will be saved to preferences (WebView can be upgraded). The service will get it during every checking task. It's better than creating a new (pretty big) WebView object inside the service - this way it will still use only ~3 - 11 MB od RAM. |
@pejakm Try this. With logging enabled. If you are using Google Chrome (mobile) you can check these addresses: When something is wrong you cannot find an element "RSS Feed". At least one URL should work. |
|
I've checked the source, there's no "RSS Feed" line anywhere. There's only "РСС" ("RSS" written in Cyrillic script). I'm using Facebook in Serbian, could this be the cause? |
Yes, I was right! I switched my Facebook to US English, and immediatelly I got a notification. :) |
Awesome! Here is my solution. I will buy some beers and spend the night switching languages and checking "RSS" word in different languages. Next I will create an enum with all the records and their locales. The app will get the right word basing on device locale. The only problem occurs when someone is using Facebook in a different language than a language of his device. Has someone a better idea? |
You need to find what? The link? Just the word? This is a relevant part of the code, right? |
I will test the following change at this line: add Edit: Nope, failed. |
Fix notifications for Facebook in other languages. Closes #78
Hey, how exactly do I enable message notifications from within the app? |
I know you use RSS for notifications for Facebook, however is there any way to add notifications for messages too? That way I can remove Facebook Messenger.
The text was updated successfully, but these errors were encountered: