Open
Description
hello guys
i need your help for resolve my solution
when i add cordova-plugin-background-mode
(ionic cordova add cordova-plugin-background-mode )
(npm install --save @ionic-native/background-mode)
and i run ios
my app stop running and he take me error
int retval = uiapplicationMain(argc,argv,nil,@"AppDelegate"); Thread 1 : signal SIGABRT
and when i remove ionic cordova add cordova-plugin-background-mode
(ionic cordova rm cordova-plugin-background-mode)
my app run normal and when i run app in backgroung he take me alert ("cordova not install")
please help me
Activity
ghost commentedon Jun 26, 2018
@abdelhamidTsouli did you find any solution for this issue?
Even I am facing the same issue in my app.
adan92 commentedon Jul 3, 2018
Has someone found the solution? I have the same issue.
Mathias-seemyapps commentedon Aug 22, 2018
Anyone please? Just installing the base plugin, like the original post explain, cause the issue. It works just fine in android but in ios there is no error, the debugger stop at "int retval = uiapplicationMain(argc,argv,nil,@"AppDelegate"); Thread 1 : signal SIGABRT" and there is nothing we can do.
DanielDimanov commentedon Sep 1, 2018
Please tell us if you found a solution!
clearblood commentedon Sep 4, 2018
Alright guys, this is what you need to do. Open up xcode (Or your editor of choice), and search for
"_requiresUserActionForMediaPlayback" (No quotes)
Replace that string with "requiresUserActionForMediaPlayback"
This is an issue that was fixed on the latest git repo, but for some reason has not made itself to npm.
DanielDimanov commentedon Sep 5, 2018
You can also pull it directly from the repo, but for some reason I still can’t play my media on background. It plays, but it lags and kind of loops every 2 seconds and then continues.
luatvudinh commentedon Apr 11, 2019
This worked for ios under 12.
It comes back again when I tried to install on IOS 12.2. Please give me a solution. Thanks.
Yask00 commentedon Apr 15, 2019
+1 for the crash on 12.2 from the example of @luatvudinh
Also i think it caused some damage on latest android version, but this is not confirmed
rodrigoti commentedon Apr 30, 2019
I'm also having the same problem
tahminabs23 commentedon May 16, 2019
I am also having the same problem in iOS 12.2
rodrigoti commentedon May 16, 2019
Try in file src\ios\APPBackgroundMode.m replace following lines
(NSString*) wkProperty
{
NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
with
(NSString*) wkProperty
{
NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
remove and add the platform again
tahminabs23 commentedon May 17, 2019
@rodrigoti Thanks, it works!
kapilSoni101 commentedon May 28, 2019
@rodrigoti not working for me sir..
rodrigoti commentedon May 28, 2019
try to change directly in the file inside the ios platform:
platforms/ios/project/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m
(NSString*) wkProperty
{
NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
with
(NSString*) wkProperty
{
NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
remember that requiresUserActionForMediaPlayback must be without (_)
_requiresUserActionForMediaPlayback, if downloaded by github, should already be correct UserActionForMediaPlayback ...
Sorry for my english, I'm not native, I'm from Brazil.
dhayaljaswantgit commentedon Jul 4, 2019
use following commands to fix that issue :
ionic cordova plugin rm cordova-plugin-background-mode
ionic cordova plugin add https://github.com/iowayankee/cordova-plugin-background-mode.git