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
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

no one here can post a PHP code sample

on how to implement the dynamic licensing?

 

 

Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

Is PHP your only option?  I could provide some Java Code to do it....
Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

yes, php is the only option I can use.
Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

[ Edited ]

Well, since no one is responding and I find that strange because I know most people are moving to PHP and most hosting companies offer free PHP over J2EE, why don't you post on a PHP forum. 

 

I'm assuming that you don't know PHP at all?  Because you shouldn't need help generating a key -- it's just code -- you need help with the PHP language itself.

 

I'm sure there are loads of examples on how to use PHP on Google--it just wont be specific to generating keys for App World.

Message Edited by RLord321 on 06-23-2009 10:14 AM
Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

I just wrote my own PHP code generator,

so no problem on doing it,

the only problem I have is how to:

 

- listen the BB store post

- what variable the store post to my server

- what variable I need to reply to the store

- is there some security code between my server and BB store to be sure that this post is generated from the store

and not from another server?

Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

sblantipodi,

 

There's a document that explains the process:

http://na.blackberry.com/eng/developers/appworld/Dynamic_License_Flow.pdf

 

In short,

 

The parameters it passes are:

  1. PIN
  2. email
  3. product
  4. version
  5. transactionid
  6. test

You need to return one string back and that is:

key=myPHPgeneratedKEY

 

Also, set the content-type to:

application/www-url-encoded

 

AND....set the content-length to the length of the entire string you send back, "key=myPHPgeneratedKEY"

 

This should get you going if you are already familar with PHP.

 

By the way, there is no security in place to verify the POST came from the server.  You could check for the IP address as a small security measure.  This can be spoofed, however.  Also, don't publish your URL that generates keys.

 

I hope this helps

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

[ Edited ]

in this way I create a security hole on my server.

can't understand how this is possible.

 

If someone will find the name of my PHP script it can full fill my database by

simply POSTing new data.

I don't like that way.

A pre-established code between app store and php server should be really useful for security.

 

PS: What is the URL where I need to reply with "key=somecode" ???

 

$header =
         "POST /WHAT_FILE_WILL_LISTEN_MY_POST.php HTTP/1.1\n" .
         "Host: www.WHATS_THE_DOMAIN_NAME_OF_BB_STORE.com\n" .
         "Content-Type: application/x-www-form-urlencoded\n" .
         "Content-Length: " . strlen($data) . "\n\n" .
         $data . "\n";

 

Message Edited by sblantipodi on 06-23-2009 11:04 AM
Message Edited by sblantipodi on 06-23-2009 11:11 AM
Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

As I mentioned.  You could also check the IP address.  Looking at my database, I'm only getting request from one IP address from AppWorld.  If you get anything other than that, then I would reject the request.

 

You don't POST back to a URL, you just reply to the current request.

 

Have you created a PHP script to respond with a string before?  It would be the same way, but just send the key instead.  I wish I knew more about PHP to give you a better answer but you need to start and existing Request/Response example in PHP.

Please use plain text.
Developer
sblantipodi
Posts: 1,178
Registered: ‎02-19-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

you are very kind, I'll look into this...

can you tell me what ip uses BB store please?

 

do you think that BB store is a good store on where to sell our software?
is there a lot of person who use this store or is only a small store with few people in it?

Please use plain text.
Developer
RLord321
Posts: 343
Registered: ‎02-23-2009

Re: Blackberry app store (I need to generate a key or to forward to my web server)

I don't want to put the IP address in the forum but you can send an email to storefrontmanager@rim.com and explain what you are trying to do and I'm sure they'll let you know.

 

Yes. I think the BB store is a good store to sell software.  There are other websites selling blackberry software but from my experience, my sales from them have reduced since AppWorld was released.  Why would you need to go anywhere else?

 

There are many customers using this store.  Right now if you put a few good apps out there, it can make you not want to work at your day job!!

Please use plain text.