Added SimplePushClient/Server samples #72

Merged
merged 1 commit into from Jan 10, 2013

Projects

None yet

3 participants

Contributor
garettB commented Jan 9, 2013

2 samples that simplify the entire push process.

@pelegri pelegri merged commit 74ee956 into blackberry:master Jan 10, 2013
Contributor
pelegri commented Jan 10, 2013

Can you also submit a pull request on the Catalog? Thanks,

@ghost
Contributor
ghost commented Feb 27, 2013

trying get it to work but having trouble. I put in all of my credentials but not sure sequence to run and what I should look for.

Contributor
garettB commented Feb 27, 2013

The log should provide details on any failures that may occur. Could you provide this output?
May also be good to get the URLs being used on either end (with the CPID removed).

@ghost
Contributor
ghost commented Feb 27, 2013

Thanks. Here is the log when I run the client. Not sure what the error is at the end :


gid[1000]
dname: "com.example.SimplePushClient.testDev_ePushClient6f379ac8"
providerApplicationId: ""
is enterprise perimeter: false
Connect to personal/consumer agent: true
sendMessage: raw payload [ "dat:json:{"dName":"com.example.SimplePushClient.testDev_ePushClient6f379ac8","perimeter":1,"providerApplicationId":"k21","targetKey":"com.samples.push.simple"}
id::createSession_15720
msg::createSession
" ]
sendMessage: write to pps: success
"WARNING: maxWidth is NOT set, returned value cannot be trusted"
pushListUpdated. New size: 0
No data:QVariant(bb::cascades::Color)
receive message: @ipc
msg::onCreateSessionComplete
id::createSession_15720

err is 0
No dat section
"Session creation completed successfully"
sendMessage: raw payload [ "dat:json:{"dName":"com.example.SimplePushClient.testDev_ePushClient6f379ac8","perimeter":1,"ppgUrl":"https://cp1716.pushapi.eval.blackberry.com/","providerApplicationId":"11","targetKey":"com.samples.push.simple"}
id::createChannel_15720
msg::createChannel
" ]
sendMessage: write to pps: success
receive message: @ipc
msg::onCreateChannelComplete
id::createChannel_15720
err:n:10110

err is 10110
No dat section

"Channel creation failed: "

On 2013-02-27, at 10:11 AM, garettB notifications@github.com wrote:

The log should provide details on any failures that may occur. Could you provide this output?
May also be good to get the URLs being used on either end (with the CPID removed).


Reply to this email directly or view it on GitHub.

Contributor
garettB commented Feb 27, 2013

I think I see the issue, from the client you should be using HTTP. On the server you use HTTPS.

You may want to remove your app-specific details from your post (app ID and CP ID).

@ghost
Contributor
ghost commented Feb 27, 2013

Thanks...I will try it.

@ghost
Contributor
ghost commented Feb 27, 2013

I am not sure if this is correct :

const QString PushManager::BLACKBERRY_INVOKE_TARGET_ID = "com.samples.push.simple";

Does this refer to the client or the server?

Thx

On 2013-02-27, at 11:47 AM, garettB notifications@github.com wrote:

I think I see the issue, from the client you should be using HTTP. On the server you use HTTPS.

You may want to remove your app-specific details from your post (app ID and CP ID).


Reply to this email directly or view it on GitHub.

Contributor
garettB commented Feb 27, 2013

That refers to the target ID in the bar-descriptor.xml file which is used to invoke the app.

@ghost
Contributor
ghost commented Feb 27, 2013

Still seeing this error after changing to http://

sendMessage: write to pps: success
"WARNING: maxWidth is NOT set, returned value cannot be trusted"
pushListUpdated. New size: 0
No data:QVariant(bb::cascades::Color)
receive message: @ipc
msg::onCreateSessionComplete
id::createSession_12782
err:n:10112

err is 10112
No dat section
"Session creation failed: "

On 2013-02-27, at 11:54 AM, garettB notifications@github.com wrote:

That refers to the target ID in the bar-descriptor.xml file which is used to invoke the app.


Reply to this email directly or view it on GitHub.

Contributor
garettB commented Feb 27, 2013

http://developer.blackberry.com/cascades/reference/bb__network__pusherrorcode.html#enumvalue-sessionalreadyexists

That error usually means that there is another app on the device using the same Push credentials, so the session is already open. If there is only one app it may be worth deleting and restarting the device as a test.

@ghost
Contributor
ghost commented Feb 27, 2013

Sorry…deleted everything and still getting same error. What would really help is if you could create a test push account and fill the two samples with working eval codes for testing. This way when I download and run it will work for sure…then I can change to my own credentials. My guess is if I am having trouble others will run into the same thing. Is that possible to do?

Thanks, Steve

On 2013-02-27, at 12:02 PM, garettB notifications@github.com wrote:

http://developer.blackberry.com/cascades/reference/bb__network__pusherrorcode.html#enumvalue-sessionalreadyexists

That error usually means that there is another app on the device using the same Push credentials, so the session is already open. If there is only one app it may be worth deleting and restarting the device as a test.


Reply to this email directly or view it on GitHub.

Contributor
garettB commented Feb 27, 2013

Not possible today and would not explain the error you are currently seeing. Devs would still need to make changes to work with their services and the same issues could arise if the info were pre-populated. I have a few folks I know of using this code without issue.

Did you restart the device after deleting all apps?

@ghost
Contributor
ghost commented Feb 27, 2013

No problem. I didn't restart … will try that now. Thanks.

On 2013-02-27, at 1:17 PM, garettB notifications@github.com wrote:

Not possible today and would not explain the error you are currently seeing. Devs would still need to make changes to work with their services and the same issues could arise if the info were pre-populated. I have a few folks I know of using this code without issue.

Did you restart the device after deleting all apps?


Reply to this email directly or view it on GitHub.

@ghost
Contributor
ghost commented Feb 27, 2013

I got it working. Mistake was changing the push URL in the client to my push URL. Just need to leave it alone.

Thanks for the help.

Steve

On 2013-02-27, at 1:17 PM, garettB notifications@github.com wrote:

Not possible today and would not explain the error you are currently seeing. Devs would still need to make changes to work with their services and the same issues could arise if the info were pre-populated. I have a few folks I know of using this code without issue.

Did you restart the device after deleting all apps?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment