It's been now 1 week that I am facing this problem. I'm trying to get the push notification service to work on my app in 3 different ways. Here are the steps I followed (I suppose registration for a developer account, creation of the app id and generation of the push certificate are done): Retrieve the device token.
PushMeBaby iPhone app :
Insert the aps_developer_identity.cer into the PushMeBaby app under Resources.
Copy paste the device token with spaces (also tried without spaces) into self.deviceToken
Copy paste aps_developer_identity into self.certificate
When running the app, I get asked to allow the use of the private key, here is the output I have :
2012-02-01 15:10:44.464 PushMeBaby[21219:903] MakeServerConnection(): 0
2012-02-01 15:10:44.482 PushMeBaby[21219:903] SSLNewContext(): 0
2012-02-01 15:10:44.486 PushMeBaby[21219:903] SSLSetIOFuncs(): 0
2012-02-01 15:10:44.488 PushMeBaby[21219:903] SSLSetConnection(): 0
2012-02-01 15:10:44.490 PushMeBaby[21219:903] SSLSetPeerDomainName(): 0
2012-02-01 15:10:44.492 PushMeBaby[21219:903] SecKeychainOpen(): 0
2012-02-01 15:10:44.493 PushMeBaby[21219:903] SecCertificateCreateFromData(): 0
2012-02-01 15:10:44.504 PushMeBaby[21219:903] SecIdentityCreateWithCertificate(): 0
2012-02-01 15:10:44.505 PushMeBaby[21219:903] SSLSetCertificate(): 0
2012-02-01 15:11:12.420 PushMeBaby[21219:903] SSLHandshake(): 0
Then when I press "push" :
2012-02-01 15:11:26.767 PushMeBaby[21219:903] SSLWrite(): 0 78
and "push" again :
2012-02-01 15:11:38.668 PushMeBaby[21219:903] SSLWrite(): 0 78
The value of the variable "processed" doesn't change ! And of course I do not get any push notification on my iPhone.
Javapns :
Download the needed libraries form the website http://code.google.com/p/javapns/wiki/GeneralRequirements
Generate a .p12 file exporting the push certificate and the private key associated to it.
Copy paste the java code
import javapns.Push;
public class PushTest {
public static void main(String[] args) {
Push.alert("Hello World!", "keystore.p12", "keystore_password", false, "My token");
}
}
into a java class, replacing the device token with the right device token without spaces, adding the .p12 file and the right password.
Debugging the project allows me to see this message :
Transmitted: device token My device token
But no notification into my iPhone !
When changing the device token I have a "invalid device token" message
php script :
Followed the steps here
Got the messages :
Connected to APNS
Message successfully delivered
But didn't get any notification on my iPhone either !
Would you guys have any idea on what went wrong ?
Could it be a problem with the provisioning profile ? But then would I be able to retrieve the device token ? I saw in some previous questions something related to the date setting so I added this in the php script and my iPhone is set to automatically set the date parameters. I think I tried also quitting the app, but nothing did. I did something unusual, which is using the app id for 2 different apps, I'm now just wild guessing since I don't know where to look. Any help would be much appreciated. Thanks
It was actually an error from the IT team which generated the wrong SSL push certificate !
And the value of the variable "processed" mentioned in the question is related to the number of characters in the payload.
Related
I'm using VB.NET to copy fingerprint template from one device to another. I've successfully pulled fingerprint template from the origin device using SSR_GetUserTmpStr. However, when set the fingerprint template to destination device using SSR_SetUserTmpStr returns -100.
SSR_SetUserInfo was successfull and the new user was registered at the destination device.
Please advice.
I'm having an issue with FCM on flutter. I have implemented messaging from my server so I'm storing my phone token for each user.
The thing is that when a user logs in for the very first time everything works properly, messages are being sent and user gets notified.
If I do not use the app during the weekend, on Monday I try to send a message by doing some actions on my app but messages are not being sent. I can see my token stored properly in my database.
I'm using firebase_messaging 2.1.0 for flutter.
This is how I get my token
_fireBaseMessaging.getToken().then((token){
_myPhoneToken = token;
});
1-I know token may change when:
App deletes Instance ID
App is restored on a new device
User uninstalls/reinstall the app
User clears app data
But none of this happens.
Any advice on how to handle this scenario? thanks in advance.
UPDATE
Provided you have setup the FCM sdk the right way (but you said that it works the fist time you install the app, so I guess so).
Provided that you are sure that the device_token you are using is the one of the device on which you are expecting to receive the notification (check if it's still the same), you should get on this device your notification quite soon if you use "priority" : "high".
{
"to" : "device_token",
"priority" : "high",
"notification" : {
"sound": "default",
"body" : "Test Notification body",
"title": "Test Notification title"
}
}
This method call
_firebaseMessaging.getToken().then((String token)
return always the new token even if it has been updated. So if you print this out on your device and you send a notification on this token without error, there's no reason why you should not get the token if the device has a valid internet connection active.
It's true that the device token can change during time. If you uninstall and reinstall the app, you can see the token will change and if you try to send a notification on the old one, you will get an error.
If instead the token will change during application lifetime, you can be notify on your server side by listening:
_firebaseMessaging.onTokenRefresh.listen((newToken) {
_fcm_token = newToken;
// send the new fcm to your server
});
So first of all I suggest you to be able to send a notification to a device with Postman. Check if the token you are using is still the one on the device. Then you can try to uninstall and reinstall the application and try to use the old token. You will get an error. Then try to send to the new one, and you should get your notification.
Then wait for some days and try again, check if the token has changed or not and if it's not changed you should be able to send the notification without problems with the same token.
Also be aware that data message on Android if the app is terminated are still not supported.
Some networks/router/mobile can cut the connection between firebase library and firebase server due to inactivity (5min without message). This cut may be detected by the library up to 30min (FCM heatbeat interval).
These are some links discussing this issue:
https://github.com/firebase/quickstart-android/issues/307
Android: Delay in Receiving message in FCM(onMessageReceived)
I contacted firebase support but they told that since the issue is caused by external part they cannot fix it (I suggest decreasing heartbeat interval ...)
I fixed it in android using an interval job which apply these instructions:
context.sendBroadcast(new Intent("com.google.android.intent.action.GTALK_HEARTBEAT"));
context.sendBroadcast(new Intent("com.google.android.intent.action.MCS_HEARTBEAT"));
You may write this specific code for Android side and should find something similar for ios side.
I am trying to connect with the youtube API using yt_oauth function but getting error as follows :
Error in readRDS(token) : error reading from connection.
I have checked my application several times. First I got the API Key and then the Client ID and Client Secret. I am using the Client ID and Client Secret for app_id and app_secret below. I have enabled all the 3 youtube APIs(Data,Analytics,Reporting)So where can I be going wrong? Any help appreciated.
Below is the code I am using
library("tuber")
app_id <- "XYZ"
app_secret<-"abc"
yt_oauth(app_id,app_secret)
Seems that you called yt_oauth previously with some invalid parameter. A file called .httr-oauth may exists at your current path (in my case it was on My Documents folder). One can remove that file or alternatively do this:
yt_oauth(app_id, app_secret, token = '')
It will force tuber to refresh the token state.
I fired up VS 2012 and created a new website with the oAuth templates and created an application with Facebook to test it out. I modified the AuthConfig.cs to contain the app id and app secret, but my login test is returning a 400 response, presumably from Facebook's server.
Here is my app configuration on Facebook:
Here is the line upon which the 400 response occurs:
var authResult = OpenAuth.VerifyAuthentication(redirectUrl);
Like I said, I've modified the two lines in AuthConfig.cs, but nothing else.
Thoughts?
Urg...I had a leading space in the app secret. This can happen when you copy and paste directly from the page. Anyhow, I removed the space, and away it went.
asp.net app (c#) worked fine in debug mode; published, getting 401.1 error (unauthorized).
When I put in the url, a dialog asks for username & password. Put it in 3x, error.
It's an internal app, using Windows authentication only.
IIS 7.5, using ApplicationPoolIdentity.
SQLServer Database
Specific Error Message from 401.1 page:
Module WindowsAuthenticationModule
Notification AuthenticateRequest
Handler ExtensionlessUrlHandler-Integrated-4.0
Error Code 0x8009030e
Requested URL http://smalltools.dbsvc.com:80/ Ap
Physical Path C:\inetpub\SmallTools
Logon Method Not yet determined
Logon User Not yet determined
The app has a users table to determine the "role" of that user. I put a method in the master page that queries the table based on authenticated user, and returns the role. This, in turns, determines which buttons are visible on the navigation bar.
Looked in the security log, and found the following 3 entries:
2012-07-20 14:55:11 10.0.1.38 GET / - 80 - 10.0.13.106 Mozilla/5.0+(Windows+NT+6.1;+rv:14.0)+Gecko/20100101+Firefox/14.0.1 401 2 5 15
2012-07-20 14:55:20 10.0.1.38 GET / - 80 DE\cin.bro 10.0.13.106 Mozilla/5.0+(Windows+NT+6.1;+rv:14.0)+Gecko/20100101+Firefox/14.0.1 500 0 0 125
2012-07-20 14:55:20 10.0.1.38 GET /favicon.ico - 80 DE\cin.bro 10.0.13.106 Mozilla/5.0+(Windows+NT+6.1;+rv:14.0)+Gecko/20100101+Firefox/14.0.1 404 0 2 0
Any idea what might be causing the inability to log in? Any clues what I can fix to make it work? I've researched all day and haven't found what might be the problem.
Any information is gratefully received.
Thanks
Cindy
I've successfully solved the issue; I had to allow impersonation, and make an adjustment to the AD group.
The article in the following link helped a great deal:
http://msdn.microsoft.com/en-us/library/bsz5788z.aspx
If this is an external site, then Windows authentication isn't really the way to go. But you can still do it, here's some links I found that should help.
Q&A about similar issue
Microsoft guide on how to implement
Typically Windows Authentication is used with internal systems because the users are logged on directly to the system and all their credentials are right there. However for external apps this isn't always the case, since your home Windows account and work windows account aren't the same, in addition you may not even be using windows from the external location.
Another gotcha I came across is the local loopback address security check when you setup a DEV instance and modify hosts file to use Fully Qualified Domain Name (FQDN) or simply when you browse IIS site with custom headers and the name does not match the server hostname. While this is necessary for production servers it is a problem when setting up Developer environments.
"This issue occurs when the Web site uses Integrated Authentication and has a name that is mapped to the local loopback address"
There are two main methods to resolve the issue:
Specify host names (Preferred method if NTLM authentication is desired) by creating/updating the Multi-String value:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
Disable the loopback check (less-recommended method - do not use on production servers) by setting the following registry DWORD value to 1
HKLM\SYSTEM\CurrentControlSet\Control\Lsa\DisableLoopbackCheck
Please refer to this HTTP 401.1 - Unauthorized: Logon Failed - Microsoft Support article for detailed overview and registry settings.