Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry® World™ Development

Reply
Administrator (Retired)
mkirkup
Posts: 179
Registered: ‎07-14-2008
My Device: Not Specified

Dynamic Licensing Clarification

One of my previous posts discussed how you could have your application automatically pick up the license key using the CodeModuleManager on the device without requiring manual intervention on the part of the user.  In performing some testing, it appears that my initial sample code  could be improved.

 

If you want to load the property directly, you should be using a format of "App Name: Vendor Name" in your call to CodeModuleManager.load.  However, we have found for some reason that on certain devices this doesn't work consistently.

 

Instead, I would recommend using the following code snippet where you iterate through the cod files on the device and then find your cod file.  This works everytime although is slightly less efficient.

CodeModuleGroup group = null; CodeModuleGroup[] groupArray = CodeModuleGroupManager.loadAll(); String moduleName = ApplicationDescriptor.currentApplicationDescriptor().getModuleName(); for( int i = 0; i < groupArray.length; i++ ) { if( groupArray[i].containsModule( moduleName )) { group = groupArray[i]; break; } }

 

 

 

 

Mike Kirkup
Director, Developer Relations
Please use plain text.
Developer
kmm1001
Posts: 47
Registered: ‎01-09-2009
My Device: Not Specified

Re: Dynamic Licensing Clarification

Hi Mike,

 

At what point in my application to call the above set of code?

Is there a specific location in the application logic to notify it it’s being deployed via the App World client so that I load the license?

Please use plain text.
New Developer
kaneumann
Posts: 2
Registered: ‎04-25-2009
My Device: Not Specified

Re: Dynamic Licensing Clarification

During installation of the application on the device, the App World client will load the license key in the CodeModuleGroup properties so an application can read it directly without having to prompt the user.

Please use plain text.
New Developer
b3nj1m4n
Posts: 7
Registered: ‎05-24-2009
My Device: Not Specified

Re: Dynamic Licensing Clarification

Is there any way to test this prior to going live (replicate RIMS license integration)?


 

Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009
My Device: 8700 | 8310 | BOLD | STORM

Re: Dynamic Licensing Clarification

I can confirm that this method works. I implemented this code for a new release of my application and if it finds the key, it says, "Game Unlocked From AppWorld!" (Do I get a kickback for that?).

 

If it does not find the key or it errors out in any way, you must manually type in the key.  This could happen if they purchase the same game from somewhere other than AppWorld.

 

 

Please use plain text.
Developer
LMcRae
Posts: 163
Registered: ‎04-16-2009
My Device: Not Specified

Re: Dynamic Licensing Clarification

  If for some reason the automagic key retrieval version doesn't work, since it's really magic if you can't test it, how does the customer get the key?  IIRC Mark said you should provide for a manual entry as a fall back but where is the key?

 

  My initial app that had no codes at all for v1.  Now I have switched it to use the dynamic license model for v2.  Since I had purchased v1 already, I was able to see if the upgrade to v2 worked and it didn't.  BTW I would suggest purchasing your app for reason such as this. The auto retrieve key code must have failed at some point and I was presented with my enter activation code screen. 

 

  Now I know my dynamic license model works with Mobihand and Handango so it's not completely broken.  So now what do I do? Is the problem caused by changing license models?  How can I test any of this?

 

 

Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009
My Device: 8700 | 8310 | BOLD | STORM

Re: Dynamic Licensing Clarification

LMcRae,

 

Do you log anything on your webserver?  You should at least be able to see AppWorld try to make a request to your webserver.  And yes, you can test this part through the testing tool.  You just can't test the auto read from the JAD file to insert the key.

 

When a user buys the app with a key, it makes a call to  your web server, and then it retrieves the key.  The key is then presented to the user with a COPY and OK button so they can COPY the key to the clipboard.  Once they run your app, they can paste it.  If they key is lost, it will be displayed when that same customer views your app again in AppWorld -- either through normal browsing or through their MyWorld.  Blackberry displays the key along with the app because it knows the customer purchased it.

 

If there was an error on yourside, hopefully you are logging it.  So when the customer emails you for support, you can check your log and figure out if there was an issue or not.

 

Did this answer your question?

Please use plain text.
Developer
LMcRae
Posts: 163
Registered: ‎04-16-2009
My Device: Not Specified

Re: Dynamic Licensing Clarification

Thank you so much for a great response RLord321.

 

I do log the transactions on my webserver and I noticed my upgrade from v1 to v2 didn't appear.  So I am guessing the license server doesn't get called for an upgrade since there would be no way of knowing that it wasn't a new purchase. I am guessing App World doesn't handle this but it should be able to by seeing it has no key. 

 

Also oddly enough all the versions I am seeing in my logs are pre v2 and none have dynamic licenses.  Has anyone else tried to convert their app from static to dynamic license?

 

Thank you for explaining the manual key presentation.  It REALLY should be in the Dynamic_License_Flow.pdf  Also there really needs to be a way to test the JAD method.

 

Thanks again.

Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009
My Device: 8700 | 8310 | BOLD | STORM

Re: Dynamic Licensing Clarification

I remember checking my table and I do see some of the same people requesting a key for the latest version.. I will double check, though.  Also, the static license model doesn't go to a server (At least I didn't think so...so how are you seeing these in your log?) at all but all dynamic ones do.. So if you are not seeing them, then I'm wondering if your upgrade has propagated to the customers phone yet.  Sometimes I do see customers buying an old version of my game which I think is weird but maybe they left AppWorld running for a long time and it never got refreshed or something. 

 

Has your upgrade been approved and everything?  Are customers saying they made a purchase but are not getting the keys?

 

Yes, the doc needs to be upgraded.  You only find out by purchasing your own app for the first time :-)

Please use plain text.
Developer
LMcRae
Posts: 163
Registered: ‎04-16-2009
My Device: Not Specified

Re: Dynamic Licensing Clarification

I believe I am seeing new purchases of old versions.  So it would seem that the license model isn't tied to each package.  This makes me wonder what happens when I submitted the new v2 with the dynamic license (DL) and changed the license model.  I am wondering if the license model change happens right away, before the new version is approved.

 

My upgrade was approved and the first thing I did was an upgrade.  When it failed I removed it from sale so I didn't get what could be over 1000 emails asking the same thing!  I am still in the dark as to what to do about it and I am suprised that RIM wouldn't test the upgrade path.  I guess $20 only goes so far :smileyhappy:  

 

Maybe I should put it for sale and try and delete my version and see if it does a http-post.  Thank again for the help.

Please use plain text.