Google App Engine modules + Task queue for iOS push notification - java

I followed the instructions from this sample but it didn't work. The frontend added tasks to pull queue notification-delivery but iOS clients didn't receive any push notification. It seems that the worker didn't do its job. I don't know if the worker automatically scan the pull queue and send out the push (using Javapns) or not. And I don't know how to check if a task in a Pull queue is processed.
What I did:
Enable billing for GAE project.
Follow instructions from the sample (edit Constants, add p12 certificate).
mvn clean install from root directory.
mvn clean package from root directory.
mvn appengine:update from cloudpush-ear directory.
Make sure Javapns works with provided p12 file by writing some code in a standalone Java class, it did send push notifications to iOS clients.
When I call PushNotificationWorkerServlet by requesting from browser to /_ah/start, it throws an error saying This feature is only available to backend instances. So I tried using ThreadManager.createThreadForCurrentRequest instead of ThreadManager.createBackgroundThread. The error was gone but nothing happened.
I think GAE with Task Queue is a perfect solution for scalable mobile applications so I'll stick with it.
Any help please? Thank you.
Reference:
https://cloud.google.com/solutions/mobile/ios-push-notifications/

Related

Azure, default "Hey, Java developers!" welcome page after successfully deployment

After succesfully deployment via Github repo of my Spring boot Application in Azure's App Service i have still "Hey java developers!" page, i tried do this via Github and Github Actions, Github and Kudu, FTP, but result is allways the same. I'm out of ideas.
UPDATE
Today, I try again. I disconnect connection. And try to reconnect, I saw build area like below.
After Action completed, it works.
So I suggest you disconnect and reconnect to solve the problem.
PRIVIOUS
According to your description, I personally tested one side and your problem reappeared.
My troubleshooting steps:
First create a default page for webapp. (Under windows, it fails, indicating that this is not).
Deploy the webapp under linux and find that everything is normal.
From the Action on github, it was found that there should be a problem with the build in the deployment under windows.
In conclusion:
It is recommended to use linux to deploy webapp. As for the deployment failure under windows, it is recommended to raise a support ticket for help.
My test result.
Under Linux, after build action, we can see app.jar file under wwwroot folder.
I also move it to windows webapp, it doesn't work.

Install and skip unverified app message using Appium

could you help me with a question? Currently I’m working in a project using react native and when I try to install this app using Appium, a message is shown indicating that there is some validation and it’s not possible to install unless it is from the official stores (App Store / Play Store).
Unverified App Message - Android
I’ve been trying to skip this message running the test scripts with some ‘adb’ commands like: adb install -i "com.android.example" but I believe that’s not the best approach.
I appreciate if someone can help me with that.
Thanks all.
If you will perform following steps manually or using script on android device. It will not show this message box.
Navigate to Setting > Security.
Check the option "Unknown sources".
Tap OK on the prompt message.
Select "Trust".

Android GCM Registration is failing

I am working on Google cloud messaging service in my android app. For this I need to register my android app to GCM server.
The gcm registration is failing.
I have checked:
The gcm register code is Async call.
The sender id (project id) is correct.
The manifest file is as per the google doc. http://developer.android.com/google/gcm/client.html
My device has google account set up.
I have tried both the cases - add google-play-services jar and import it as project.
I even went on to specify the version number (com.google.android.gms.version) in manifest as per this http://developer.android.com/google/play-services/setup.html#Setup
Where and why would this be failing?
When I catch the exception, exception cause is NULL.
I had done a demo app for this GCM part and it was working fine. I had used Eclipse with JellyBean SDK.
I extended this project to make the current app - package stucture remains same. But now am on Kitkat SDK.
I used the same Sender Id as before to register with GCM. It failed giving null id. I created new project at cloud console and used its project number as sender id. Still same error. Registration Id is null. I don't think Sender Id should be any issue.
Any help would be appreciated.
So is GCMRegistrar Class giving out, that it failed to register?
i think it could be your Manifest file - check everything correctly until you are really sure you did everything right.
I had an other problem when i implemented GCM into my Project. It was giving out "Regestration OKay" but the REG_ID from GCM Server that i needed to read out, was giving me an Empty (not NULL) it was empty LOL.
I moved my MainActivity (where the regestration happens) in the "original" package of my project and it worked.
please follow Push Notification via GCM
if key for browser apps doesn't work, then create key with ip locking and replace it into your config.php file, it will sure work.
please also check whether your client side code works properly or not on this site
I am getting the GCM Registration Id now. I made two changes.
Removed debuggable=false from Manifest file. Wrote a code in the activity to check for version of Play Store.
So conclusion, it was the issue with play store version may be.

Overriding Tigase OfflineMessages class

I'm developing a chat application using Tigase server in the background for providing the XMPP communication. Besides that I'm using smack/asmack as a library in my application.
With every message send between the users, for the sake of the functionalities I want to implement I'm including package extensions via smack's Presence.setProperty() method,which are correctly send if both of the users are online. When one of the users is offline the Tigase server saves that message and then delivers it when the user becomes online again. The thing is that Tigase don't save the message including the packet extensions, so when the user is online again it receives only "parts" of the message send.
I found the Tigase source and found the place in the OfflineMessages class part of the xmpp.impl package, where I need to insert a line of code in order for msgoffline plugin to save the offline messages using extensions.
What is the easiest way to override the OfflineMessages class in Tigase jar file, without building the whole source code of the project?
I'm using Tigase-5.1.5-b3164 version on ubuntu server and Eclipse as IDE.
I do not know Smack library, hence I do not know what Presence.setProperty() method does. But if it does something to a presence packet (adding an extra payload to the presence status) then this will not be saved to offline message storage because.... presences are not stored in offline message storage.
If you want to modify OfflineMessages to make it store more different data than it stores now (like a specific presence packets) then there is a method: savePacketForOffLineUser with a big IF at the beginning. This is where the decision is made on what to store in an offline storage.
But, please be careful not to store ALL presences, it will kill your service and your database.
The best way to add your own plugins is to make a copy of the existing Tigase plugin (OfflineMessgae), modify it to your preferences, change a name of the plugin and ID of the plugin. Then you just put a jar with your code into Tigase jars directory and modify configuration to load your plying instead of the default one. This way you do not have to recompile Tigase sources and will be also easier for you to update to a new version.

Using own Java software´s custom update implementation

I have a server, and Client that are working fine, they transfer file to each other and handle commands with success. The thing is that once connected to the server, the server can ask the Client to update itself.
Since I did everything using sockets with a TCP connection, and I am NOT able to use java web start, I am looking for a way I can update the software.
One thing I thought was:
Making the java call another java software and close itself. Then the other java software, would connect to the server again and waits for the update request, so it could replace all files from the current version (lib directory and the jar main file - Im using Netbeans).
Maybe I could just send the connection Object to the Software that would update, but the main only accpets String.
So I ask two questions here:
Is this a good solution? Or is there a better one?
If I do that, how can I send the Client Object of my proto from one application to another?
I would suggest keep a property file on server having latest version of app.
Each time you start the app compare version if its updatable then download all new updates in a temp dir
After SUCCESSFUL download invoke another small application to copy those files to your lib file in order to update your app actually
At the end prompt user that app has been updated and launch the newly updated app. i would say.

Categories