Adding PushNotification service to an iPhone app - iphone

I am trying to implement Push Notification from server site in my application since many day but I am unable to get push notification service in my application. but I am getting this error:
error : Domain=NSCocoaErrorDomain Code=3000 'no valid' aps- environment' entitlement string found for application UserInfor=0x170140 {NSLOcalizedDescription=no valid 'aps- environment' entitlement string found for application}
Can any one help me out to resolve this error?
Or give me some more clear steps what I am missing in my application.
Actually I have to Send notification on some changes in my Server side application. Like If some one post a Blog on the site it should be shown in every app holder. For this we need to generate the JSON. So my main worry is how to connect my Server or my JSON updates with PushNotification service. I Think now it's more clear.
Thank you.

perhaps this will help you:
http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/
and try to do a bit of googling!!

Related

Push Notifications in Ionic 2

I am building a Chat application in Ionic 2, and need to implement Push Notifications.
Due to the fact that Google have recently moved their GCM service to rather use FCM, there is not much documentation how to implement an Ionic app with it. I have found the following tutorial which looks to do exactly what I need.
The tutorial seems good, however, I am confused on a few issues, and any help would be appreciated.
I am developing on a Windows machine, so currently just building for Android.
Question 1
I am confused with the following statement:
Build and run on real android and iOS devices to see device token in
console.
When I run ionic build android, it does not generate a device token in the console. Do you know how I can see what the device token is?
Or, is it just generated at run time by data.registrationId, and this is passed to the server?
push.on('registration', (data) => {
console.log("device token ->", data.registrationId);
//TODO - send device token to server
});
Question 2
In the Java,
static String API_KEY = "YOUR_GCM_API_KEY";
static String device_token = "YOUR_DEVICE_TOKEN";
For static String API_KEY = "YOUR_GCM_API_KEY";, is the YOUR_GCM_API_KEY the Server Key or Sender ID from FCM?
Is the static String device_token = "YOUR_DEVICE_TOKEN"; received from the Ionic app when you do this: console.log("device token ->", data.registrationId);? i.e. Is it passed from the client to the server?
Question 3
If we are sending separate messages to individual devices, e.g. for a Chat App, how do we differentiate between devices? Each chat message has an id associating it with a unique pair of users (e.g.[userId1,userId2]), but your example uses a device token, how do you send it for the unique user pair rather?
Question 4
I get the following at run time in the browser.
EXCEPTION: Error: Uncaught (in promise): TypeError: push.on is not a function
Can I ignore this? I suspect it is only happening in a browser and I won't get this error when it runs on a real devise.
UPDATE
It looks like all questions, apart from Question 3 have been answered below. I am guessing it can be done with some sort of pub/sub model on a key that's unique to the chat.
Question 1
It is a devise token passed from client to server: data.registrationId.
Question 2
YOUR_GCM_API_KEY is the Server Key generated by the FCM.
YOUR_DEVICE_TOKEN is passed from the client: data.registrationId.
Question 3
Not sure yet, am investigating further?
Question 4
The error can be ignored, it does not occur on a devise.
I haven't tried ionic before, but I'm gonna go on ahead and try to give my ideas with regards to your questions where I think some will be at the very least helpful:
Pretty sure that simply means to run the app on an actual device, not an emulator or a browser. Given the name, I think the reason why they're requiring to run an actual device is because maybe it is an ID that is retrieved from the device itself.
It's the Server Key. NOTE: You should ALWAYS keep the Server Key and Sender ID a secret.
For GCM/FCM one thing that is commonly used is a registration_token, which I think in this case, is the counterpart for the device token.
Not sure with this one. I did see this similar post, though it's still unresolved. Do look around the community, there might be another post similar to it.

Get suggested invitees failed due to error code: 3

I'm trying to run App Invites demo on a kitkat device but it returns
Get suggested invitees failed due to error code: 3
and soon after
Create invitations failed to error code: 3
What kind of error is it? Where i can find an error list?
In my experience, this happens when the SHA-1 signature of your app is not compatible with the Android API key specified in the Google Developer Console
If you don't care which app invites you, then you might want to consider removing app/signature restrictions. Otherwise, simply add them.
Log onto Firebase Console: https://console.firebase.google.com
You will need to click on the "Add Fingerprint" button and then add on your SHA1 key. You do not need to redownload your google-services.json, you just need to add the SHA1 key.
Try sending an app invite from your app. It will now work.

Error: The application has already been subscribed to by another user for this company

I am locally testing an app that integrates with Quickbooks IPP. I had connected to a demo account provided by Quickbooks developer program when I signed up but it didn't have enough data so I created my own demo account with a copy of a bunch of good data. I then cleared out the tokens and stuff in my app stored from the other demo account so I could start over. The problem is, now when I try to connect my app to this new qb account (using a different login to Quickbooks), I just keep getting this error:
Oops! An error has occurred.
Please close this window and try again.
Error Code: invalid_database
Message: The application has already been subscribed to by another user for this company
I don't see how anyone could have connected to this local app before, but just in case, I went to the "Manage My Apps" screen and the only thing I see there is "QuickBooks Online".
It is probably not related, but I'm also getting a javascript error message after clicking "Authorize" in the Intuit popup.
Line: 3
Error: Unexpected call to method or property access.
When I attempt to debug the javascript it is code in jQuery but seems to stem from the "notifyDoubleClickOfSalesActivity" function in the "Intuit.DFA.min.js" file.
What can I do at this point? I know my code is good because I was able to connect the first time.
Go to you developer account and disconnect all connected connections. This should clear up the issue.
If not, please submit a support ticket through appcenter.intuit.com.
If you already have a valid access token/connection for a particular company, another user from the same company cannot again authorize access. That is the error you see. If you go into your account on appcenter you can disconnect that IA connection, so you are able to re-create it with another user. Your code can also call the disconnect API to disconnect it, and lastly you can login as the end user and go to your account and disconnect the app.
Jarred

Getting error in receiving push notification using apple push notification service in ios

I have developed a application that uses appcelerator cloud service and APN everything working fine I was able to register the device for push notification and even able to successfully send notification but in the receiving path of the notification I am getting error like UILocalNotification keyed archive array contains invalid classes: *** -[NSKeyedUnarchiver decodeObjectForKey:]: data to unarchive contains class (NSDecimalNumberPlaceholder) which has not been allowed. Ignoring.
I am not able to trace what this error try to say please help me out.
Thanks
Pushpa
Just ran into this as well. It seemed to consistently happen for me when you set the badge in the APNS payload to a negative number. See if this goes away if you add a check on your server to make sure the badge is always set to >=0.
Hope that helps.
Cheers,
Ashu

Not able to get Pushnotification

while i'm using push notification in iphone with local server(used php), not able to receive the notification...it shows an error like "Connection timed out (60)".....
can any one tell me clear idea for implementing the server side code (php)
Check this site: http://www.easyapns.com/.
They show all the steps and give to you a simple APNS server in php/mysql.
Hope it helps.