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
New Developer
Posts: 11
Registered: ‎11-13-2008
My Device: Not Specified

Re: Dynamic Licensing and Automated License Key Capturing

[ Edited ]

Hi all, just thought I'd post my testing on this topic.

 

I found that this:

String key = CodeModuleGroup.load("My App").getProperty("RIM_APP_WORLD_LICENSE_KEY"); 

 

Doesn't really work. After enumerating all of the modules on the device I found that mine was more like "My App:My Vendor Name" instead of "My App". I implemented this instead:

 

	private static CodeModuleGroup getCodeModuleGroup() {
CodeModuleGroup groups[] = CodeModuleGroupManager.loadAll();
for( int i = 0; i < groups.length; i++ ) {
String name = groups[i].getName().toLowerCase();
if( name.indexOf( "podtrapper" ) != -1 ) {
return groups[i];
}
}
return null;
}

 

(Obviously replace podtrapper with your app's name)

 

And I use it like this:

 

    cmg = getCodeModuleGroup();
if( cmg != null ) {
key = cmg.getProperty("RIM_APP_WORLD_LICENSE_KEY");
....
}

 

I have verified that this returns the codemodulegroup for my app, and that the getProperty call returns the code from the app world if present (though I've had reports of that code not actually showing up even after the user purchases, and the app dissappearing from "My World" altogether).

 

 

Hope this helps. It's crazy how this is all playing out...

 

-Marcus

VersatileMonkey.com


 

Message Edited by marwatk on 04-24-2009 01:31 PM
New Developer
Posts: 50
Registered: ‎01-22-2009
My Device: Z10
My Carrier: Rogers

Re: Dynamic Licensing and Automated License Key Capturing

I can confirm that the missing Content-Length property was the cause of my earlier issue.  Registrations are now 100% fine, using the dynamic model.

 

Marwatk: 

 

Thanks for your post.  Have updated the codemodule group stuff with your code.  Can't confirm yet if it works, and anyway we are not relying on it.

 

Best,

 

Dave  

Developer
Posts: 343
Registered: ‎02-23-2009
My Device: 8700 | 8310 | BOLD | STORM

Re: Dynamic Licensing and Automated License Key Capturing


marwatk wrote:

Hi all, just thought I'd post my testing on this topic.

 

I found that this:

String key = CodeModuleGroup.load("My App").getProperty("RIM_APP_WORLD_LICENSE_KEY"); 

 

Doesn't really work. After enumerating all of the modules on the device I found that mine was more like "My App:My Vendor Name" instead of "My App". I implemented this instead:

 

	private static CodeModuleGroup getCodeModuleGroup() {
CodeModuleGroup groups[] = CodeModuleGroupManager.loadAll();
for( int i = 0; i < groups.length; i++ ) {
String name = groups[i].getName().toLowerCase();
if( name.indexOf( "podtrapper" ) != -1 ) {
return groups[i];
}
}
return null;
}

 

(Obviously replace podtrapper with your app's name)

 

And I use it like this:

 

    cmg = getCodeModuleGroup();
if( cmg != null ) {
key = cmg.getProperty("RIM_APP_WORLD_LICENSE_KEY");
....
}

 

I have verified that this returns the codemodulegroup for my app, and that the getProperty call returns the code from the app world if present (though I've had reports of that code not actually showing up even after the user purchases, and the app dissappearing from "My World" altogether).

 

 

Hope this helps. It's crazy how this is all playing out...

 

-Marcus

VersatileMonkey.com


 

Message Edited by marwatk on 04-24-2009 01:31 PM

marwatk,

 

If that's the case, can't you just use:

 

String key = CodeModuleGroup.load("My App:My Vendor Name").getProperty("RIM_APP_WORLD_LICENSE_KEY");

?

 

Do you know if the vendor name was case sensitive or not?

 

Thanks

New Developer
Posts: 11
Registered: ‎11-13-2008
My Device: Not Specified

Re: Dynamic Licensing and Automated License Key Capturing


RLord321 wrote:
marwatk,

 

If that's the case, can't you just use:

 

String key = CodeModuleGroup.load("My App:My Vendor Name").getProperty("RIM_APP_WORLD_LICENSE_KEY");

?

 

Do you know if the vendor name was case sensitive or not?

 

Thanks


 

If you could get the vendor name to match then that would probably work (though I don't remember if there's a space between the colon or not). Not sure on case sensitivity. In my case I'm trying to be resilient to upgrades via my site or the app world (which have different vendor IDs, my old stuff used slightly different text, and you can't control your JAD on the app world).

 

So far with my testing I've been able to properly upgrade over the different installs (web and app world), but apparently not all of my users are so lucky. I haven't figured out what cases cause a problem, though.

 

-Marcus

New Developer
Posts: 2
Registered: ‎04-25-2009
My Device: Not Specified

Re: Dynamic Licensing and Automated License Key Capturing

Can some one please confirm or clarify the following:

Is there a specific point of when to make a call to ‘CodeModuleGroup’?

Or is this

 

From Mike Kirkup earlier posting: This property only gets installed when your application is deployed via the App World client itself so it makes sense that you are seeing a null return value right now.

 

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

 

I wish that the folks at the App World would provide us with a complete example on how to use this feature.

Highlighted
New Developer
Posts: 7
Registered: ‎05-24-2009
My Device: Not Specified

Re: Dynamic Licensing and Automated License Key Capturing

I have just heard that App World now sends PIN's to dynamic licensing web services as Hex. They were sending them as decimal, but as developers weren't expecting it, it caused problems and they changed it to Hex.
Developer
Posts: 343
Registered: ‎02-23-2009
My Device: 8700 | 8310 | BOLD | STORM

Re: Dynamic Licensing and Automated License Key Capturing

b3nj1m4n,

 

You are correct...... You could always check the length, though...and if it's the decimal format length (10 numbers), you can convert it to HEX and then check to see if it's a valid PIN.  But this is all old news and is water under the bridge now.

 

 

New Developer
Posts: 7
Registered: ‎05-24-2009
My Device: Not Specified

Re: Dynamic Licensing and Automated License Key Capturing

Good idea about checking the length.Thanks.

 

I wish it had been old news to me Smiley Wink I didn't see any mention of that on the forums - only talk that it had been decimal and not the Hex people were expecting - nothing anywhere suggesting otherwise. Are there some juicy threads re: dynamic licensing I should be reading? I had done quite a bit of looking around. Perhaps if I had an app out at the time I would have known about it.

 

Other news..The Knowledgebase article there is a link to in the Dynamic licensing PDF does not exist, and Rim say they plan to remove that link. Shame - I'd have liked to have seen a kb article on it. They are also working on a sandbox so developers can test dynamic licensing apparently, which sounds mighty useful.

 

 

Developer
Posts: 343
Registered: ‎02-23-2009
My Device: 8700 | 8310 | BOLD | STORM

Re: Dynamic Licensing and Automated License Key Capturing

Hmm... I downloaded a copy of that PDF..seems like it might be a collector's item now!  If you send me a private message on here with your email address, I can send you a copy.
New Developer
Posts: 7
Registered: ‎05-24-2009
My Device: Not Specified

Re: Dynamic Licensing and Automated License Key Capturing

[ Edited ]

thanks, but it's not the pdf - it's the link to the kb article in the pdf (page 2).  Appreciate the offer though.

 

think I should be ok on this issue now, my implementation appears to be working as much as I can test for prior to going live - the kb article just would have made it a bit quicker and easier I think.

Message Edited by b3nj1m4n on 05-26-2009 12:17 AM