cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.2: Auto registration - wrong user for device after uninstall / reinstall of the app

Former Member
0 Kudos

Hello.

We are having the following issue with SUP 2.2 (we did NOT have it with SUP 2.1 #3 and previous versions).

We have autoregistration enabled for our Android app.

This is the way to reproduce the problem:

      - Install the application in the client device.

   

     - Register the application.

     - Login to the app, the app works fine.

     - Uninstall the application.

     - Install the application.

     - Register the application --> crashes: Auto registration - wrong user for device : Device already register wih username, security config and application id that doesn't match current values.

----

So, if the app is uninstalled, it can't be registered again. The app connection must be deleted manullay in SCC.

This is a show-stopper when we have 300 clients (users), and some of them might uninstall the app at a given point or even accidentally.

Also, how do I know which of the 300 clients app connection I have to manually remove from the SCC? There is no way I can get the UUID autogenerated by SUP for the client.


Message was edited by: Michael Appleby

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

That resolusion of deleting the user connection is good when only having few users. but bad at that scale, did you find a solution?

Cheers

Former Member
0 Kudos

Hi ,

I am new to SMP and using SMP 2.3. We have 300+ client users for our application.

Can anybody tell me how to register seperate usesr for 300+ users in SCC to install the app/ipa.

Regards

Neha Pandey

shivakishore
Explorer
0 Kudos

Hi Former Member,

In your application Please try using the following code for registration:

// /delete user registration from sup server///
public void deRegisterDevice() {

   //Check if the user is registered. If so, delete the user
   ODPUserManager usrMgr = ODPUserManager.getInstance();
   if (usrMgr.isUserRegistered()) {

    usrMgr.deleteUser();

}

}

then write the code for onboarding.

For complete sample application please refer the application from the following link:

http://scn.sap.com/docs/DOC-33704

thanks & regards,

Shivakishore

Former Member
0 Kudos

Wouldn't you be able to find the previously registered application connection by username?

Former Member
0 Kudos

We can have several users by device, and so we're using a master user to register the app (all clients are registered with the same user).

Anyway, we could take the approach to register each client with a different user.

This, hoewever, still means that you need someone to manually delete a connection from the SCC once a user uninstall / reinstalls an app. This wasn't necessary in SUP 2.1.3, and you could uninstall / reinstall / register as many times as you wished without worrying about this kind of error.

jan-hua_chu
Explorer
0 Kudos

For Android, you should be able to use the following code to get the Device ID

 

com.sybase.mobile.Application.getInstance().getApplicationSettings().getConnectionId()

So, after you hit the registration error, you should use the above code to get the device ID. Then use SCC to delete that device from "Application Connections" tab.

Former Member
0 Kudos

Thank you for the info on getting the connectionId from the device.

However, we still need a process that sends this info to an admin, and then he has to delete the connId manually.

This seems flawed to me.

brenton_ocallaghan
Active Participant
0 Kudos

Hi Pablo,

There should be a method called "unregisterApplication()" on the SUPApplication which should have the effect of deleting the registration within the SCC and so leaving it clear to be re-registered as a new connection the next time it is connected. Have you tried using this API?

That is an automatic API and does not need admin involvement. More info on the API can be found here.

Hope that helps,

Brenton.

Former Member
0 Kudos

Hi Brenton, thanks for your answer.

However, in this scenario:

     1) Install the app

     2) Register the app

     3) Uninstall the app

     4) Register the app

In step 4, the app is not registered, and so you can't call unregisterApplication (it will say: you must register the application first).

In step 4, if I try to register the application, it will fail with the messaged posted above:

Auto registration - wrong user for device : Device already register wih username, security config and application id that doesn't match current values.

The only solution I've found is to delete the previous app connection in SCC in step 4, before registering the app. This requires an admin.

As I said earlier, I haven't found this issue in SUP 2.1 #3.


midhun_vp
Active Contributor
0 Kudos

What is the SUP version you are working on ?

This scenario usually would not happen. Dig into the properties of the MBO package well. It is related to the properties of the MBO package you created.

For your reference:

Login code:


if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED) {






app.registerApplication(600);




} else {





app.startConnection(600);




}

Logout code:

if (app.getRegistrationStatus() == RegistrationStatus.REGISTERED) {

                                                  app.startConnection(600);

                                            app.unregisterApplication();// delete the user from scc.

                                        }

- Midhun VP

Former Member
0 Kudos

Hello Pablo

I Think i found a Solution using Brenton OCallaghan information.

When you register if it gives the wrong user for device error then you can unregister the aplication and register it again like:

Try {

     Register(app);

    

} catch (WrongUserException e) {

     app.unregisterApplication();

     Register(app);

}

Cheers,

Laguerta

Former Member
0 Kudos

I'm having the exact same issue.

1. Register the app.

2. Uninstall the app.

3. Re-install the app.

4. Now the app's registrationStatus on the client says unregistered, while I still see the application connection in the SCC.

5. Now calling unregisterApplication is ineffective.

I tried the solutions suggested here by Daniel, that didn't work too.

Any inputs on this would help.