MoPub for iOS: 'Target is not running or required target entitlement is missing' - swift

I'm trying to monetize my app with MoPub for iOS 14, but my ad is not being shown and I get the following messages in the logs when trying to display an ad:
Initialized OM SDK version: 1.3.4-Mopub
Attempting to load ad
[assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
[ProcessSuspension] 0x10b0b8bc0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 18829, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
SDK initialized and ready to display ads.
Initialized adapters:
No adapters initialized
Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
In my AppDelegate's application(_: didFinishLaunchingWithOptions:) function, I have the following:
let sdkConfig = MPMoPubConfiguration(adUnitIdForAppInitialization: "TestAdUnitID")
sdkConfig.loggingLevel = .info
MoPub.sharedInstance().initializeSdk(with: sdkConfig, completion:{
GameViewController().showAd()
})
I have a view controller that adheres to the MPAdViewDelegate protocol and loads the ad like this, after the SDK has finished initializing:
self.moPubBannerView = MPAdView.init(adUnitId: "TestAdUnitID")
let adSize = kMPPresetMaxAdSize50Height
let bounds = view.bounds
var adFrame = CGRect.zero
adFrame.size = CGSize(width: 320, height: 50)
adFrame.origin.x = (bounds.size.width-adFrame.size.width)/2
adFrame.origin.y = bounds.size.height - adFrame.size.height
self.moPubBannerView?.frame = adFrame
self.moPubBannerView?.maxAdSize = adSize
self.moPubBannerView?.delegate = self
self.view.addSubview(self.moPubBannerView!)
self.moPubBannerView?.loadAd()
I have set Privacy - Tracking Usage Description in my info.plist. I'm testing on a real device, using the correct MoPub SDK.
Any idea what could be causing this error, and how to fix it? Thank you for your help!
EDIT:
Initially, I had integrated the MoPub SDK manually -- but I tried integrating using cocoa pods, too, and received the same errors/problems.
EDIT #2:
MoPub responded to my support request by telling me that I need to include an entitlement, without telling me which entitlement I need. So, I know I'm missing an entitlement, I just need to know which one.
EDIT #3:
I tried a different advertisement provider's framework and ran into the same error. So, it must be my problem -- not MoPub's. I tried enabling the Access WiFi Information capability (and confirmed that it was added to my App.entitlements) and I also added App Transport Security Settings -> Allow Arbitrary Loads to my Info.plist. But the problem remains.

Related

zoom swift sdk crashes after connecting to a meeting

i am trying run the zoom swiftdemo app referenced in their Github repo
but i keep getting this error whenever i connected to a meeting
ZoomiOSSDKDemo[1944:343363] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xe10f, name = '.1516928314.rpc'
See /usr/include/servers/bootstrap_defs.h for the error codes.
I can connect to a meeting but it crashes a few second after connecting. What does the error message mean and how can i fix this?

iOS 14 gives "OS Error: Bad file descriptor, errno = 9" when doing local network broadcasting

Doing a little Jeopardy style Q&A here.
I'm developing an app in Flutter that uses the udp package for broadcasting on the local network. This has worked fine on Android, Windows, macOS and iOS until I tried on an iOS 14.6 device.
The code flow is mainly like this:
var endPoint = Endpoint.broadcast(port: Port(6000));
var udpFuture = UDP.bind(Endpoint.any(port: Port(6000)));
udpFuture.then((udp) {
udp.listen((datagram) {
handleMessage(datagram.data);
});
udp.send(bytesToSend, endPoint);
}
The error message I'm getting is this: Unhandled Exception: OS Error: Bad file descriptor, errno = 9
Starting from iOS 14 your app needs the Multicast networking entitlement com.apple.developer.networking.multicast to be able to send or receive IP multicast traffic.
To get the entitlement you need to apply using Apple's request form. It took me 4-5 days before I got the request approved.
Then you can follow the instructions on Apple's forums to get up and running.

AppleMusicKit SDK / Sample Project - UserToken issue

I'm currently experimenting with the Adding-Content-to-Apple-Music code found here: https://developer.apple.com/musickit/
I'm using:
XCode 9 beta 2,
iOS 11 (iPhone 5s)
I have a developer token (which works when I query the Apple Music API searching songs etc...) but I now want to use this to exchange for a User Token so I can perform write actions against my Apple Music account.
The test app fires up and allows me to request authentication. From this I can see:
MPMedia Library - Authorized
SKCloudServicesController - Authorized
Capabilities:
Add to Cloud Music Library
Music Catalog Playback
My next obvious step is to use the developer token to gain the user token. However, as soon as I call the following:
cloudServiceController.requestUserToken(forDeveloperToken: developerToken, completionHandler: completionHandler)
i see the following error in the completionHandler - can anyone help?
2017-07-14 10:05:39.179300+0100 Adding-Content-to-Apple-Music[1326:172100] [MC] Reading from public effective user settings.
2017-07-14 10:05:40.635503+0100 Adding-Content-to-Apple-Music[1326:172299] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2017-07-14 10:05:40.636449+0100 Adding-Content-to-Apple-Music[1326:172100] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2017-07-14 10:05:40.800933+0100 Adding-Content-to-Apple-Music[1326:172297] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2017-07-14 10:05:40.801259+0100 Adding-Content-to-Apple-Music[1326:172299] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
An error occurred when requesting user token: The operation couldn’t be completed. (SKErrorDomain error 1.)
In Settings > iTunes & App Store on my device I am logged in with my Apple ID. Same goes for Apple Music too.
Update on this:
I also posted about this over on the Apple dev forums. It was an error on their side and now appears to be fixed. I can get a UserToken in both iOS 10 and 11 now.

Realm, Swift and App Sandbox not working?

I can't get Realm (lastest version), Swift and Sandboxing to work.
I created a Hello Word app with RealmSwift / Realm embedded binaries included correctly.
import RealmSwift
..add one class and only the line:
let realm = try! Realm ()
Then I got this error when I run the app:
*2016-08-17 21:04:05.404 testprosjekt1[37407:21624950] ***storageTaskManagerExistsWithIdentifier:withIdentifier failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.nsurlstorage-cache was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";
}
2016-08-17 21:04:05.412 testprosjekt1[37407:21624950] ***cachedResponseDictionaryForRequest:key:handler failed: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.nsurlstorage-cache was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.nsurlstorage-cache was invalidated.}; {
NSDebugDescription = "The connection to service named com.apple.nsurlstorage-cache was invalidated.";*
}
If I turn off sandboxing - I got NO error at all.
So, my question is: Is the latest version of Realm NOT working with sandboxed apps?
I have tried set Read / write on to all the directories in sandboxing, but this does not help.
I use xCode 7.3
Realm works well with sandboxing (until you try to reader or write to a directory you don't have access to).
Realm collects anonymous analytics and checks for updates when your app is run with a debugger attached, or when it runs in a simulator. This call does not run when your app is in production, or running on your user’s devices. See more at FAQ.
Also if you perform any network calls in your app add com.apple.security.network.client to your entitlement (or simply enable Outgoing connection (Client) in Capabilities tab of your project's settings).

Gettng Error WLClient onInvokeProcedureFailure:userInfo in WLClient.m

We are getting below error while calling a simple HTTP Adaptor through iOS Apple Watch OS1. We have mobilefirst 6.3 with WorklightAPI iOS deployed on server.
[WL_CLIENT] -[WLClient onInvokeProcedureFailure:userInfo:] in WLClient.m
Status: 0
InvocationResult: (null)
InvocationContext: (null)
Error code: 3
Error message: Procedure invocation error.
It runs fine when we run it on development server. Only difference we see is on Test server TLSv1.2 is enabled while on development it is not.
We defined ATS --> Allow Arbitrary Loads = YES in info.plist
but we are still getting an error.
Any Advice ?
As mentioned multiple times, Apple Watch is not supported. And in any case, since this is Watch OS 1 it means you invoke the code from the "parent" iOS app, no? In which case this was answered in your other question: https://stackoverflow.com/questions/34206002/there-is-no-registered-challenge-handler