In a WKWebView I am receiving this warning when I upload the image to our server using FormData via Ajax. The entire process completes successfully.
Can anyone suggest what is the missing entitlement. I have reviewed entitlements related to WKWebView
In the console I see that the pid is associated with "webkit.uploads"
"Required client entitlement is missing"
requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>
// xcode debug console on submit
MyDomain[3002:428982] [ProcessSuspension] 0x104be68a0 - ProcessAssertion() PID 3002 Unable to acquire assertion for process with PID 3002
MyDomain[3002:427999] [ProcessSuspension] 0x104be68a0 - ProcessAssertion::processAssertionWasInvalidated()
MyDomain[3002:428982] [assertion] Error acquiring assertion: <NSError: 0x281b3b6f0; domain: RBSAssertionErrorDomain; code: 2; reason: "Required client entitlement is missing"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x100f2ee40; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
// javascript upload code
var formData=new FormData();
formData.append("action", 'save');
var fileInput = document.getElementById('addImage');
if (fileInput.files && fileInput.files[0]) {
var file = fileInput.files[0
formData.append('messageImage', file);
hasFile = true;
}
if(hasFile){
$.ajax({
type: "POST",
url: "/images/save",
data: formData,
dataType: 'json',
contentType: false,
processData: false,
success: function(result){}
});
}
I had a hunch about this and other errors coming from wkWebView, and I think I proved it. It has to do with the file uploads taking too long, and iOS complains about it, and wkWebView gets "released" (according to another thread). In my case, my uploads were taking between 5 and 13 seconds.
I implemented my upload in a Web Worker, which turned out to be a little tricky on Cordova, but all of the issues went away once I did this.
So my fix only seemed to address this in the emulator on my dev machine, which is using iOS 13.3. When I build on my "production" machine running iOS 13.7 the error returns. It was happening on both environments before moving file upload to a Worker.
It would seem Apple is in the process of adding something to iOS that is triggering these but has not yet documented or explained it. That's my new theory.
Related
Our App was disabled a week ago due to violation on 6.1 and we tried to fix the issue
I have tried reimplementing the login following the instructions on the Facebook login setup guide. Also tried updating from 9.0.1 to the latest version 12.1.0
I can confirm that the info.plist is correct, the permissions are correct, bundle id is correct, and we only use test accounts.
However this error still throws, I could not find any references to fix this.
Could anyone help?
Don't know if this helps but the android app using version 5.4.0 build is working fine
Error Domain=com.facebook.sdk.core Code=8 "(null)" UserInfo={NSRecoveryAttempter=<_FBSDKTemporaryErrorRecoveryAttempter: 0x1630097f0>, NSLocalizedRecoverySuggestion=The server is temporarily busy, please try again., com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Unsupported request, com.facebook.sdk:FBSDKGraphRequestErrorHTTPStatusCodeKey=400, com.facebook.sdk:FBSDKGraphRequestErrorGraphErrorCodeKey=1, NSLocalizedRecoveryOptions=(
OK
), com.facebook.sdk:FBSDKGraphRequestErrorParsedJSONResponseKey={
body = {
error = {
code = 1;
"fbtrace_id" = ANc5PSXRGPTACuYqqxYTDda;
message = "Unsupported request";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:FBSDKGraphRequestErrorKey=1}
From your error response, it seems like you are requesting data from a not-existing API or that your token is invalid
error = {
code = 1;
"fbtrace_id" = ANc5PSXRGPTACuYqqxYTDda;
message = "Unsupported request";
type = OAuthException;
};
from Facebook's docs: OAuthException | code= 1
//API Unknown//
Possibly a temporary issue due to downtime. Wait and retry the operation. If it occurs again, check that you are requesting an existing API.
I have a Cordova (vers 9) app that uses phonegap-plugin-push (v2.3.0) on cordova-ios (v4.5.1) that does not register for notifications when run on an iOS device, (iPad mini iOS 9.3.5). I am using Xcode (vers 8) within MacOSX Sierra. The xcode project Capabilities tab has push notifications turned on, the project builds without error and the App ID configuration has Push Notifications enabled with a valid certificate. Additionally, it does not show as having access to notifications in the settings for the app on the iOS device nor does it prompt for access when run.
How do I narrow down where the registration problem is? Does the device I am running it from have anything to do with it? Am I missing a call that requests access to notification in the code? Am I missing an error routine that might let me know what the problem is?
Actions I have taken:
Uninstalled/reinstalled cordova
Uninstalled/reinstalled ios
Uninstalled/reinstalled phonegap-plugin-push
Changed order they are added
Fixed numerous build errors that prevented the app from building or signing.
Placed app into debugger and stepped through Javascript code where register takes place.
Exported provision profile from release build and examined to ensure entitlement is present.
var app =
{
// Application Constructor
initialize: function ()
{
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function ()
{
console.log( 'mobile-rewards: bindEvents() called' )
document.addEventListener( 'deviceready', this.onDeviceReady, false );
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function ()
{
const push = PushNotification.init(
{
android:
{
},
browser:
{
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios:
{
alert: "true",
badge: "true",
sound: "true"
},
windows: {}
});
// e.message
push.on('error', function(e)
{
console.log(e.message);
});
push.on('registration', function(deviceInfo)
{
console.log("device info - "+deviceInfo.registrationType+":"+deviceInfo.registrationId);
});
push.on('notification', function(data)
{
console.log(data.message);
});
},
};
// initialize the app.
app.initialize();
I expected the plugin to register successfully but it doesn't appear to have done so. There is no error present coming from the error handler and the plugin appears to function normally. The debug output log from the plugin shows progress through the entire PushPlugin.m code for the init. The exported app shows the aps-environment provision within it for production. However, the application neither returns a registration ID, prompts for notification access, nor shows up as even needing these privileges in the settings.
I have an react-native app which runs fine in xCode (both in simulator and on iPhone). However when uploaded to TestFlight and installed through TestFlight the app crashes when first started. When you then open the app again it runs fine.
I use Bugsnag to get error reports from the app after released to TestFlight. The error I receive in Bugsnag when the app crashes is:
TypeError undefined is not an object (evaluating 'e.props.onChangeToken')
And the stacktrace:
main.jsbundle:518:677
main.jsbundle:37:1281 value
main.jsbundle:18:2853 value
main.jsbundle:18:280
main.jsbundle:18:2304 value
main.jsbundle:18:252 callFunctionReturnFlushedQueue
However this does not tell me much ...
I suspect that it might be connected to Firebase since around when the app crashes I:
login to Firebase with:
firebase.auth().signInWithEmailAndPassword(email, password)
request initial notification:
FCM.getInitialNotification().then(notif => {
this.setState({
initNotif: notif
});
request permission for notifications:
FCM.requestPermissions({ badge: false, sound: true, alert: true });
However I'm not sure. Has anyone ever received a similar error message?
EDIT
Found one (!) other case of the same error in a comment to the article here: https://blog.botreetechnologies.com/how-to-send-push-notification-to-the-android-phones-using-react-native-and-fcm-b28e1746da7b
This implies that it could be related to FCM...
Turns out that the error was caused by the fact that I called:
FCM.getInitialNotification().then(notif => { this.setState({ initNotif: notif });
Before requesting permission for sending notifications... :
FCM.requestPermissions({ badge: false, sound: true, alert: true });
I'm trying to develop a Push Notifications feature in an app by first trying to send them through the app, which I've heard masterKey is required for. Although I haven't heard of anywhere I can put the masterKey into my Xcode project.
Is there a specific location to include the masterKey in my Xcode project? Can masterKey even be used in a swift project?
Yes, masterKey must be used to send push notification but Parse-server is not going to support pushing from client apps due to security issues. So, you need to write a cloud function for it. A simple cloud function that send pushes to all users who have installed your app looks like this.
Parse.Cloud.define("push", function(request, response){
var message = request.params.message;
//Pushes work with Installation table
//So, you need to select to whom you want to push
var installationQuery = new Parse.Query(Parse.Installation);
//You should set expiration time when push will be expired
//This is optional
var expDate = new Date();
expDate.setDate(expDate.getDate() + 1); //The notification will expire in 1 day
//Setting up push data
var data = {"badge": "Increment", "sound": "default"};
data['alert'] = message;
//Sending push
Parse.Push.send({
where: installationQuery,
data: data,
expiration_time: expDate
},{
success: function () {
response.success("Pushed successfully");
},
error: function (error) {
response.error(error);
},
useMasterKey: true
});
});
In your iOS app,
PFCloud.callFunctionInBackground("push", withParameters: ["message":"Pushing from cloud code"]) {
(response: AnyObject?, error: NSError?) -> Void in
//Do stuffs
}
Hope this helps
masterKey is added server side. depending on your setup or instance you can set it up in your index.js file.
// With the value of your app's Master Key completed:
masterKey: process.env.MASTER_KEY || '<your app's Master Key>'
If you are using environmental variables you can set your json file with this value:
"PARSE_SERVER_MASTER_KEY": "#####",
Should be in the same file where you set the paths to the certificates.
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.