Keep getting TOO_MANY_REGISTRATIONS from blackberry push registration - android

I am trying to port an android project to a BB10 app. I have followed the instructions to implement BB Push as closely as I can. I have successfully registered one of our apps on push, but when I try and register another the server returns with "TOO_MANY_REGISTRATIONS" on the GCM intent. Any help appreciated.
Project 1 - android.cfg (values changed for security and to illustrate point)
<android>
<push>
<appid>XXX1-XXXXXXXXXXXXXXXXXXXXXX</appid>
<ppgurl>https://cpXXX1.pushapi.na.blackberry.com</ppgurl>
<tokenprefix></tokenprefix>
</push>
</android>
Project 2 - android.cfg
<android>
<push>
<appid>XXX2-XXXXXXXXXXXXXXXXXXXXXX</appid>
<ppgurl>https://cpXXX2.pushapi.na.blackberry.com</ppgurl>
<tokenprefix></tokenprefix>
</push>
</android>
EDIT:
I tested both the apps on same phone (Z10), so as I understand it, it would've generated same device token?

I eventually solved the issue. I had to security wipe the phone. This isn't necessarily needed though. I did not understand that on BB10 you need to delete the app to clear cache. So it may have been possible just to delete app and reinstall.
After reinstalling my apps from a fresh OS, it works perfectly. Also good to note:
<ppgurl>http://cpXXX2.pushapi.na.blackberry.com</ppgurl>
http not https, otherwise you get INVALID_SENDER

Related

'Cannot read property 'listRegistrationsByTag' of undefined' from Microsoft.WindowsAzure.MobileServices.Push.RegisterAsync

This is a Xamarin.Forms app running on Android, based on the Azure getting started Mobile App example.
I'm trying to register a device's id for notification services. Originally I was getting unauthorized, so I relaxed authorization settings on the backend. Now I am getting this error and cannot find a reason why.
I checked and double checked that notification hub has the correct Firebase details that align with the app and cannot see what the problem is here, any help appreciated.
John,
If you set WEBSITE_PUSH_ENABLED=false in your appsettings, does the problem go away?
Can you check your Mobile App's app settings?
Specifically, I am looking for the existence of the app setting "MS_NotificationHubName". If that app setting doesn't exist, you need to add it, with the name of your notification hub.
There is a bug in the Azure App Service Push blade right now. A fix is being rolled out. In the interim, instead of using RegisterAsync(), use the method described in the book http://aka.ms/zumobook - chapter 5.

Installation failed with message INSTALL_FAILED_DUPLICATE_PERMISSION… C2D_MESSAGE possibilities

(if you came here by googling looking for a solution for this error,below links will give you an answer,also my question has kind of an explanation!)
Possible duplicate of
INSTALL_FAILED_DUPLICATE_PERMISSION… C2D_MESSAGE
Error -505 INSTALL_FAILED_DUPLICATE_PERMISSION
Wait!
I got this error today in a live project.User came with the 505 error unable to install the app.Then i ran it on IDE!
If you download an app with this mentioned issue from play store you will get an error with 505 when you try to install.
If you try to run it using your IDE you will get the error like in above image! (correct me if I am wrong)
Then I was looking for reasons.
This was my issue!
<permission
android:name="in.wptrafficanalyzer.locationroutedirectionmapv2.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="in.wptrafficanalyzer.locationroutedirectionmapv2.permission.MAPS_RECEIVE" />
Surprise thing was another developer's app on a particular users phone used the same signature! Damn, those copy pastes met each other today!!
I think if I try to declare same permission in two applications with
same package name this error can occur.(correct me if I am wrong)
Here are my 2 questions?
1.Do they need to be with the same permission? anyway they will get this thing when its same. lets say app A users a pkg.name with permission permission.RECEIVE app B use same package with another permission CONFIGURE_SIP.Can this occur when they meet each other?(seems like a stupid question but I want to confirm the other app that was there in the client's mobile had the same thing!)
2.What are/is there any other the possibilities that this error can occur?
An application defines a custom permission using signature level security
You attempt to update the installed app with a version signed with a different key
The test device is running Android 21 or newer with support for multiple users
Got those 1 2 3 from this post ! Are they true? If yes any good explanation about them will be great or any additional reason for this error?
There are many good answers in the mentioned posts!Not asking how to fix this! But how it gets generated! Also if I mentioned/understood something wrong please do note it down!!
Thank you.
Edit : As I mentioned please note that the issue came form an app which is already in the Play Store. And about the other app I have no idea! It's there in the client's mobile.Probably its also from play store because even developer options was not activated till I try to run on that mobile.He did not had any previous apps from my company as well.He just tried to download the app got 505 error and came to fix it.
And also my first option was the removal of that permission an it made the app install successfully(not the right thing but to confirm where the issue was). That is the reason that I need to know the possibilities of this error!
#commonsware blogs has explain it in details in Custom Permission Vulnerability and the 'L' Developer Preview:
Near as I can tell, the “L” Developer Preview requires that all apps
with a <permission> element for the same android:name value be signed
by the same signing key. The actual protectionLevel or other values
inside the <permission> does not matter. Even if they are identical, an
app trying to define the <permission> will fail to install if an
existing installed app already defines the <permission>. Specifically,
the installation of the second app will fail with an
INSTALL_FAILED_DUPLICATE_PERMISSION error.
Here the answer from #commonsware: https://stackoverflow.com/a/11730133/4758255
Your problem isn't permissions. It's impossible to have two apps with the same manifest package name.It must be unique. So system think that user try to reinstall/update old app with new signing certificate. From android developers blog
If the signing certificate changes, trying to install the new application on to the device will fail until the old version is uninstalled.
EDIT:
I run some tests with permissions. I think, behavior is very similar with application package name. Error occur only if 100% matching. Results:
app A(package test.test) vs app B(package test.test2)
package="test.test">
<permission
android:name="test2.example.h"
android:protectionLevel="signature" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.test2">
<permission
android:name="test.example.hr"
android:protectionLevel="signature" />
permission A - test.example.h vs B - test.example.h - DUPLICATE_PERMSSIONS error
test.example vs test.example.h - success
test.example.g vs test.example.h - success
uses-permission doesn't affect on errors/installations. But I think you can get SeciurityException in runtime, if try to use others permissions.

Android, Bluemix Error 401 : You are not authorized

I downloaded the sdk from here, created an application but when i run the app the logcat notifies:
Error 401, Failure: You are not authorized.
I tested the Bluemix app with the sample code you can find here, obviously switching the default parameters with my app's ones.
Solved.
I downloaded the April jars, the most recent ones. That worked.
A 401 error sounds as if the Mobile Application Security (MAS) is not set up correctly. Could you try going to your mobile back end on Bluemix, clicking the MAS service, turning the "Enable Client List" switch to on, and then adding your bundle id under iOS? Additionally, confirm that you've copied the client-id & client secret correctly into the properties file for the application.

unable to cast to personal whitelisted receiver app

I have successfully used the Android TicTacToe app to cast to the TicTacToe receiver app (AppID "TicTacToe"), using unmodified code from the TicTacToe example on github.
Next, I tried to use my personal receiver app. I got the email a couple of hours letting me know that my device was whitelisted and providing the AppID. I put the AppID in line 90 on GameActivity.java (not line 91, as stated in the instructions), and I also put it in line 35 of tictactoe.html (this step was missing from the instructions, but I assume it is needed). I also followed all steps in the Common Errors section of the instructions.
When I click the Start button in the Android app, the Tic-Tac-Toe board appears in the Android app, but the Chromecast device does not noticeably react.
Here is the LogCat:
07-28 00:13:47.776: W/StartSessionTask(10892): StartApplicationRequest failed with status: -4
07-28 00:13:47.826: E/ApplicationSession(10892): StartSessionTask failed with error: failed to start application: request failed
07-28 00:13:47.826: D/GameActivity(10892): start session failed: failed to start application: request failed
Try checking the box that says "Send this Chromecast's serial number when checking for updates".
Mine didn't work at first, after doing this and restarting mine seemed to pick up the whitelisted appID.
As mentioned by the author of question: Make sure to do from ChromeOS, Windows or Mac OSX client until they fix the issue from Android app.
Clients can be downloaded here: https://cast.google.com/chromecast/setup
This was fixed for me after I restarted the chromecast by removing power.
I tried Aaron's answer several times (was finally able to get the setting to stick using the Chromecast Mac app) but it still was giving this same error.
Then, I discovered I actually uploaded the receiver file to the wrong url. So double check which url was actually whitelisted!
Though even after fixing the url it still was broken. So I think I must have entered the wrong serial number when I made the whitelist request. I resent the whitelist request and the new app ids are working properly.
I solved same problem by using HTTP instead of HTTPS for my local hosted receiver, it seems Chromecast looks for valid certificate.

Using the Google map API in Android, using a proxy

I am using the google map API in a very basic app. But the problem is that on running the app, I only see the grid and the map controls...the map doesnt even load in the virtual device.
I have internet running in the device...the browser seemed to be loading just fine, so it isnt an internet problem.
Also, i did obtain an API key after registering for the map API and included that in my main.xml file...but still it doesnt show the map...just grids.The permissions for using the internet are also granted in the manifest file.
Im using the Google API level 8.Any idea how to fix this?
thx.
EDIT 1: Can anyone please help me out with this...really need help :(
EDIT 2: Well I found the following error in my LogCat:
Sending checkin request
Checkin failed: https://android.clients.google.com/checkin (request #0)
org.apache.http.conn.ConnectTimeOutException: Connect to /209.85.231.100:44 timed out
So basically my connection is timing out...im not really sure why...could anyone provide some fix for this plz?( but the AVD's browser is able to work perfectly, no time out problems..sites are able to load properly)
Also, the pre-installed maps application is showing the following error:
**Network Failure** Wrong remote strings version.GMM Server must be hosting:/strings_remote_533149424.dat
If you know any way i could fix this, it would be extremely helpful...
Thx.
Apparently if you are using a proxy, and have set that in your APN, then your AVD cannot load any application that is using the map, neither the pre-installed one, nor any created by you.
Reference: http://code.google.com/p/android/issues/detail?id=3764#makechanges
Unfortuantely there is no solution for this (yet).
Thx to all who helped :)
PS: If any1 found a solution using the proxy...or any other way to fix this...do post here..
You should not make your network(proxy) settings in your emulator or device. Just open your network settings in your PC. Then go the properties. you will find the list of items in your connections. go to IPV4 and set your default gateway and DNS server.
I faced the same error
**Network Failure** Wrong remote strings version.GMM Server must be hosting:/strings_remote_533149424.dat
Then i followed the above steps. I got the output.....Just check out and reply....
Make sure that these permissions are in your manifest file, outside the closing application tag:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Is your emulator connected to the internet? some times the emulator fails to connect to the internet when it boots, you should see a 3g sign on your notification bar.
Seen this issue posted many times, and have written up a really easy tutorial which has helped folk such as this previous question on SO
It generally tends to be one of 3 issues :
API key is incorrect
You are using the standard Android emulator and not the Google APIs.
You have extended Activity instead of MapActivity
Hope this helps.
This is most likely due to the API-key being wrong. Make sure you're using the correct API-key. (The key will be different for your debug certificate (keystore) and the certificate you use to sign the APK before you publish it to Android Market).
To generate an MD5 fingerprint of the debug certificate, first locate the debug keystore. By default, build tools create the debug keystore in the active AVD directory. The location of the AVD directories varies by platform:
Windows Vista: C:\Users\.android\debug.keystore
Windows XP: C:\Documents and Settings\.android\debug.keystore
OS X and Linux: ~/.android/debug.keystore
See http://code.google.com/android/add-ons/google-apis/mapkey.html for more details.

Categories

Resources