Blackberry Push Notification-Push service sdk error - blackberry

I install the blackberry sdk push server and i get app id and the port and i used the tutorial SamplePushEnabledApp i registred it with those data
Application ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PPG Base URL** http://pushapi.eval.blackberry.com
Push Port: xxxxxxxx
For push initiator application i use the url https://XX.XX.XX.XX:8443/sample-push-initiator/ successfully create application using this, provide APPID, name and service level = Push-Essential. appID is same as provide by RIM.
I am trying to push msg from push menu item but it's give me error INVALID subscribers.
I had add subscribers name as APP_ID given by RIM, I had also tried device PIN No. as subscriber name but same error occurs.
plz help me to solve this issue.
Is there any solution for that?

There are three things required to sent a request from client side: APP id, push port and PPG base url
and three things required to send a response from server side :PPG base url, push username and push password
check whether you are using the exact credentials that are provided by Blackberry. If these dont match, it gives the above error

Though this may be very late to answer your problem/issue faced while implementing push service in BB device, But as, very recently I successfully able to implement this and I know how difficult to do this if you are not a BB app developer.
Hope you have gone through the below url for installing BB push service sdk on your PC.
http://developer.blackberry.com/bbos/java/documentation/push_service_sdk.html
http://developer.blackberry.com/bbos/java/documentation/developing_push_enabled_app.html
So for this if you are able to install the push service sdk(bpss-1.2.0.29.exe) you will be having one BPSS directory and under this the below thing will get created.
apache-tomcat-7.0.26
logs
pushsdk-high-level
pushsdk-low-level
Uninstall_BPSS
Push_Service_SDK_for_Java_InstallLog.log
Now I have used the pushsdk-low-level to push.
you can access this web app(push initiator cum content provider) by
https://localhost:8443/pushsdk-low-level
But before start pushing from this low-level push initiator you need to properly install the sample pushDemo app on your device.
NOTE: You can't test push service using the simulator.
Then you need to register with the Port(XXXXX), AppId(XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXX) and BPS server URL: http://cpXXXX.pushapi.eval.blackberry.com, Push Initiator Application URL: http://XX.XXXX.XXX.XX:8443/pushsdk-low-level, and use pubic(BIS) network selected.
Now let me tell you what this sample pushDemo does.
first it will try to use the Push initiator application URL to subcribe/store the BB device PIN to have the information about all PINs that have been register with your Push initiator(here our push-low-level app). But for testing this you can ignore by commenting the below code line in RegisterCommand.java class of the sample PushDemo app
ContentProviderProtocol.performCommand( ContentProviderProtocol.CMD_SUBSCRIBE, username, password, isEnterprise, tx );
Now run this modified app on you device and insert all data required for registration, you will be asked to input username/password, give anything. and register it should register successfully.
Once you have successfully registered your app on your BB device.
Now you should be able to push from your push-low-level web app to your pushDemo client app on your device. NOTE: the address that is been asked on push-low-level push page is nothing but the PIN of your device.
Ping me if you any other help on implementing this.

Related

How do I use Parse.com's push notification feature for a change in PFObjects?

Can I use Parse.com’s push notification feature to send an array of PFObjects to the user when either a new one is added, or an existing one is deleted?? If so, how should I go about it? I’m writing an app for iOS. Any help would be much appreciated.
Edit:
After doing a bit of searching, I see I have to use the cloud code aftersave() method, and then send a push notification through JavaScript.
If anyone could provide examples of how to go about it, that would be great. In the meantime I'm going through the docs. Thanks again all.
The Parse Documentation really contains everything you need to get started. Writing the code that sends the actual notification is only a small part of the whole process that is required to send push notifications. Here are the steps required:
Create an SSL Certificate: create the cert via Apple Developer Center then export it with Keychain Application
Create Provisioning Profile: also done via Apple Dev Center.
Configure Parse App: Change Parse settings, then upload the cert you created in step 1.
Configure App in Xcode: Change app to use provisioning profile you created in step 2.
Add Code to Prompt user for Notifications: write the code in your app that asks a user if they want to receive Push notifications, then store their device ID in Parse Installation class.
Send the Notification: as mentioned earlier this is the easiest step of all. It can be done via the Parse Dashboard (Click on Push notifications when looking at the Data Browser), via the Parse API or via Cloud-code. I did it via Cloud-Code and it looks like this:
// Find the Installation (i.e. iOS Device) that belongs to my user*
var query = new Parse.Query(Parse.Installation);
query.equalTo('user', user);
Parse.Push.send({
where: query, // Set our Installation query
data: {
alert: "This is the notification message",
badge: "Increment"
}
}).then( function(){
console.log("Push notification successfully sent!");
});
*I added a field in my installation class that captures a user. That way I know which device belongs to which user and can send targeted Push Notifications.
Prepare for Release: When you release your app, you will need to do some additional configuration to get everything ready to release.
Again, I recommend the Parse Docs. They are comprehensive and very helpful. Let me know if you have any additional questions. Hope this helps!
** BTW: If you don't have any experience with cloud-code, then you can complete steps 1-5, then manually send the notifications via the Parse Dashboard.

Apple Push Notifications from WebApi app

I am using PushSharp for Apple Push Notifications and it is working from console app and windows service on Windows 8 and Windows Server 2008R2, but the same code transferred to WebApi app on the same computers does not work. I've installed certificate and private key via mmc in Personal (the private key is available, granted permission for IIS_USRS) and Trusted Root Certificate Authorities.
Code is kind of obvious, but just in case:
var push = PushBroker();
var appleCert = File.ReadAllBytes("C:\Users\Documents\Certificates\Push.p12");
push.RegisterAppleService(new PushSharp.Apple.ApplePushChannelSettings(false, appleCert, "pwd"));
PushSharp.Apple.AppleNotification notif = new PushSharp.Apple.AppleNotification()
.ForDeviceToken("xxx")
.WithAlert("Updated...")
.WithBadge(1)
.WithSound("default");
push.QueueNotification(notif);
//Wait for queue to finish
push.StopAllServices(true);
No errors/exceptions etc., its just the iPhone device does not get notifications when initiated in WebApi app.
Have you checked all the event handles for errors? There's alot of them on the PushBroker instance where you can subscribe to intercept the error (if there is any).
Subscribe for: OnServiceException and OnNotificationFailed.
Check if the IIS|app|users|roles has all the privileges to access the web.
When I had this error it was a certificate issue. Make sure you are using the correct certificate for production, since the first parameter is false in ApplePushChannelSettings, otherwise the message will not get delivered. Also step through the code and see if any errors are being generated but not logged.

Unable to Test BlackBerry PushService SDK on Simulator

I am Java Developer but recently I got some project related to BlackBerry Push Service implementation. My objective is to write the server side implementation for the Push Initiator i.e. the content provider. but to test this I need to use some sample push enabled app also.
I have gone through the BB Developers guide and have done below steps:
Registered for BB Push service evaluation API and received the confirmation mail with all the required details like: appId, pwd, PPG Url for BIS, port number etc.
installed the BB Push installer for low-level-Push-Imitator(i.e. the web app content provider) and the sample push enabled app(PushDemo_sample available on BB Push service Developers guide).
Now I am testing this push-enabled app on simulator and trying to register. But as the sample app tries to first subscribe with the Push-Initiator(CP) before registering with BB Push server. I have commented the below code as I don't want the subscription part.
The RegisterCommand class handles the subscription and registration.
protected void execute() throws Exception {
// first we register with Content Provider
Logger.log("Reached RegidterCommand execute() method .. but eacapingCMD_SUBSCRIBE");
//ContentProviderProtocol.performCommand( ContentProviderProtocol.CMD_SUBSCRIBE, username, password, isEnterprise, tx ); // commented
// if the registration is successful we register with BPS
Logger.log("Now Going to register with PPG");
BpasProtocol bpasProtocol = PushLibFactory.getBpasProtocol();
bpasProtocol.register( tx, isEnterprise );
// update the registered state
PersistentStorage.setRegistered( true );
}
But after configuring the app with the proper appId, PortNumber and BPS server URL, dummy push initiator application url, When I clicked on register, It is showing some IOException:
Command 'register' failed with error: java.io.IOException: could not find a service book entry for IPPP.
In the app logs on simulator I can see that it is trying to open the BB Push eval url with some parameters appended after the url like below:
Opening URL: http://cpXXXX.pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=XXXX-sxxxxxxxxxxxxxxxxxxxxxxxxxxxx&osversion=7.1.0.318&model=9900&deviceside=false&ConectionType=mds-public
Here I am just trying to register my simulator with the BB Push server. Is it not possible to test the Push service on simulator? or I am doing anything wrong?
and one more doubt how the register() method of PushLib50 class of the sample push app is appending the extra parameters after the eval URL?
Please help. Point out if I am doing anything wrong to implement the push service.
You cant test push notification in simulator. you need real device for that.
Refer this site
The BlackBerry Push Service is an essential component of the real-time, always-on experience of BlackBerry smartphones. It offers an efficient and reliable way of sending information to your users. It also lets your application process information in the background and notify users when their attention is required.

How does an iOS device identify itself to server without user log in

I am writing an iOS app with a Rails API backend. The Rails backend will serve JSON data to the app. I have the following requirements.
The app will be a free download
The app will show data on a map
The app will show data in the vicinity of the user
Upon loading the app the device should send some unique identifier to the server identifying itself as a device that is running this app.
There will be no authentication for the user as it is not required. The data is available to anyone who downloads the app. All the server needs to know is that the client is a device running the app. The server cannot serve data to any other client
I would like to run the data using SSL between the device and server
The user location will be sent to the server and the server returns the corresponding pieces of data that are in the vicinity of the user
The client receives the JSON and caches the data locally.
Question: Given these requirements, how to set up steps 4 & 5?
Also: If I want to search more on this topic what keywords should I be googling for?
Consider using OpenUDID or SecureUDID.
I give you 2 options.
First of all, the easy way. From some time, apple forbids access to the device ID. However, they give you a device token instead.
To get this unique token, the user must register for remote notification.
Upon application launching, call the following function:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
Then this callback will be called:
- (void)application:didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken.
Send the token to your server and you're done. Problems with this approach are obvious. Your user will have to register for remote notification.
Another approach is to use the MAC address of the wi-fi board.
To do this:
IPAddress.h
IPAddress.c
Import this files into your project.
Then use this function:
InitAddresses();
GetHWAddresses();
for (int i=0; i<MAXADDRS; ++i)
{
//There is a way you can obtain more info about the hw_addrs, but in general, it's the first.
NSLog(#"MAC: %s", hw_addrs[i]);
}
FreeAddresses();
Create a hash using the mac address above and you're done.
Hope it helps.
Upon first launch, the app sends a request to the server saying Hi, I'm a new client, give me an id! The server generates a new, random id and sends it back. The app saves the id locally and uses it henceforth to uniquely identify itself.

BlackBerry Push Service return rc=10002, what that means?

when i try to register to the Blackberry push service from the real device i receive this response from their server "rc=10002"and wont register to the service.
what this response means and why im getting this now (the same code was working fine at the same device and network).
Thanks.
From the source code included in the API examples rc == 10002:
The push application id specified is
null or empty or if the push
application with the given id cannot
be found.

Resources