Appcelerator login API getting error in response Unexpected identifier - ios

I am using Appcelerator iCloud·Cloud.Users.login·API its callback is giving me following response:
{"success":false,"error":true,"message":"JSON Parse error: Unexpected identifier \"An\""}
I am stuck on the things and not able to move forward, Our live App users on App Store are also affected from this.
Problem comes when we open Appcelerator Titanium project from Xcode and build the app from there and run on iOS simulator or device.
Here is the code which I am using:
Cloud.Users.login({
login : userId,
password : password,
}, function(e) {
//alert(e);
Ti.API.info("In success ....Cloud.Users.login..");
Ti.API.info('response from login service'+JSON.stringify(e));
if (e.success) {
Ti.API.info('User successfully login');
} else if (e.error) {
Ti.API.info(e.message);
_activityIndicator.hide();
alertWin.close();
}
//button.show();
});
In my case its going in else part because of response which I provided "success":false in the JSON which I am getting in callback function from Appcelerator cloud API.
Help me to resolve this error I am getting in callback.

Related

Problem with react-native InAppUtils.receiptData

I use the react-native-in-app-utils (6.0.2) component in my react-native app. After upgrading a lot of components and libraries I'm unable to get the users receiptData using the InAppUtils.receiptData() function. Before upgrade this works fine.
After running
InAppUtils.receiptData((error, receiptData)=> {
if(error) {
Alert.alert('itunes Error', 'Receipt not found.');
} else {
// receiptData is undefined/empty and I'am therefore unable to verify the receipe with the users iTunes-account.
}
});
receiptData is undefined/empty and I'am therefore unable to verify the receipe with the users iTunes-account.
Before trying to get the receipt I run InAppUtils.loadProducts(..) which works fine, I get all my products.
Any suggestions?

"Internal" Error When Submitting Form With Firebase onCall Function on IOS Safari

I am trying to submit a form but I get an "internal" error after submit on IOS Safari. Happened on two separate devices. I'm using Firebase functions onCall function. Client code:
var contactForm =
window.firebase.functions().httpsCallable('contactForm');
let result = await contactForm({ accountUID, foldersFilter,
firstName, lastName, email, cellNumber, dobDay, dobMonth })
And server code:
exports.contactForm = functions.https.onCall(( data, context ) => {
return contactForm.contactForm( data, context )
});
This function is called via form. The form works great on chrome, safari desktop, but for some reason it gets an internal errror sometimes when testing on IOS device. At first I thought it only happened when I was using autofill, but I've tested more and I get the same error when not using autofill too.
The confusing thing is my function code is actually never being called (I don't see any firebase function logs). Here is my console in safari:
The network connection was lost.
Fetch API cannot load https://us-central1-projectId.cloudfunctions.net/contactForm due to access control checks
Failed to load resource: The network connection was lost.
internal
Why won't this form submit on ios safari?
I fixed the issue. Turns out it has something to do with Google Cloud Functions being IPv4, and Safari requiring IPv6. I suspect this will become a bigger issue moving forward. I'm having to move all onCall Firebase functions to https triggers. In order to make https triggers work, you have to use a custom domain in Firebase hosting and rewrite to your function endpoint.
{
"hosting": {
...
"rewrites": [
{
"source": "/api/contactForm",
"function": "contactForm"
}
}
and so now instead of calling https://us-central1-projectId.cloudfunctions.net/contactForm to trigger my api. I call https://customdomain.com/api/contactForm

Cordova Facebook plugin - sending message

For my Cordova app I'm using the Facebook plugin for Facebook integration. I'm using the version from here: https://github.com/Telerik-Verified-Plugins/Facebook and it worked well for login and sending message using the Facebook Messenger until I updated to iOS 9.
After following the instruction from here: https://developers.facebook.com/docs/ios/ios9 I managed to make login working again, but sending messages through the Messenger app doesn't work.
The "LSApplicationQueriesSchemes" contains the "fb-messenger-api20140430" entry in info.plist, but when I try to send the message I see the following error in the console:
-canOpenURL: failed for URL: "fb-messenger-api20140430://dialog/share?version=20140430" - error: "(null)"
The plugin uses the Facebook iOS SDK version v3.21. I tried to update to the latest version from series 3.x (3.24), but I encountered the same problem.
Here is the code used to send message:
var fbLoginSuccess = function (userData) {
console.dir(userData);
if (userData.status == "connected") {
var options = {
method: "send",
link: "http://example.com",
name: "Hello"
};
var success = function () {
console.log("Message sent");
};
var failure = function (error) {
console.dir(error);
};
facebookConnectPlugin.showDialog(options, success, failure);
}
};
Any ideas how to fix it?

Pushplugin- Unable to register the device (IOS)

I am using Phonegap Pushplugin for my push notifications. Added logs in both methods. didRegisterForRemoteNotificationsWithDeviceToken method never got executed. It is not even failing on didFailToRegisterForRemoteNotificationsWithError. Not sure what is the issue here.
I uploaded IOS distribution certificate (Not APN) to steroids build service and uploaded APN Prod profile to AdHoc build. I am getting the prompt for push notifications and I can see that notifications are enabled for my app. Issue is, I am not getting the token.
Looked at the following link for debugging steps
Plugin link
I am using the following code for registration.
function registerDevice(){
var pushNotification = window.plugins.pushNotification;
pushNotification.register(
tokenHandler,
errorHandler, {
"badge":"true",
"sound":"true",
"alert":"true",
"ecb":"onNotificationAPN"
});
}
var onNotificationAPN = function(event) {
var pushNotification = window.plugins.pushNotification;
if ( event.alert )
{
navigator.notification.alert(event.alert);
}
if ( event.sound )
{
var snd = new Media(event.sound);
snd.play();
}
if ( event.badge )
{
pushNotification.setApplicationIconBadgeNumber(successHandler, errorHandler,
event.badge);
}
}
function tokenHandler (result) {
steroids.logger.log("Tokenhandler called with result");
steroids.logger.log(result);
alert(result);
}
function errorHandler (error) {
steroids.logger.log("errorHandler called with result");
steroids.logger.log(error);
alert('error = ' + error);
}
Any help is appreciated.
Update- 07/30/14
I downloaded PersistentConnectionLogging.mobilecondig and I was able see the generated token. I was able to send a notification to my phone using this token.
tokenHandler and onNotificationAPN still not getting fired. Issue is clearly on Cordova side or in my Javascript.
Is this plugin even working on Cordova 3.1/3.5 ? It is frustrating that there is no community support on this plugin.
Any ideas.
Here's how i'm implementing push notifications:
Handle the certificates. Tutorial
Register and get the token. Tutorial
Store the token using NSUserDefaults.
Create a custom plugin and pass the token from objective-c to javascript by creating a custom plugin using a JS bridge. Tutorial

Facebook plugin for Unity: FB.PublishInstall is not showing up in facebook dashboard. Am I doing something wrong in the following code?

The following code on IOS returns confirmation in the xcode logs that the debug statements are going off, so every function listed below is working.
Any idea what facebook isn't noticing it? And yes, I have filled out the code in the settings for unity/facebook menu.
We get responses from the FBPublishResponse function " Facebook Publish Response: true", so it SEEMS to be working?
void Awake()
{
Debug.Log("***--- FaceBook Enable Called ---***");
FB.Init (onInitComplete, onHideUnity);
DontDestroyOnLoad (gameObject);
}
void onInitComplete()
{
Debug.Log("***--- FaceBook Enable Response ---***");
fbReady = true;
Debug.Log(" FB.Init completed: Is user logged in? " + FB.IsLoggedIn);
FB.PublishInstall (FBPublishResponse);
Debug.Log("***--- FaceBook Enable Finished ---***");
}
void FBPublishResponse(FBResult response)
{
Debug.Log (" Facebook Publish Response: "+response.Text);
}

Resources