iOS API 2.0 Retrieving the XID - xtify

I am using the latest SDK for iOS and I have put the suggested code in init method of my appDelegate:
[[XLappMgr get] setInboxDelegate:self];
[[XLappMgr get]setDeveloperRegisterNotificationSelector:#selector(doSomethingAfterRegister:)];
[[XLappMgr get] setDeveloperXidNotificationSelector:#selector(doUpdateXid:)];
The doSomethingAfterRegister method is called successfully but not the doUpdateXid one.
My aim is to get the Xid value and I would like to know when is the right time to do this task.

Related

Class AVAssetDownloadTask is implemented in both CFNetwork and AVFoundation

When using Xcode 11.3 and running on watchOS 6.1.1, I see the following conflicts
objc[45250]: Class AVAssetDownloadTask is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork (0x4ddd0ec) and /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AVFoundation.framework/AVFoundation (0x16aea494). One of the two will be used. Which one is undefined.
objc[45250]: Class AVAssetDownloadURLSession is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork (0x4dddd44) and /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/AVFoundation.framework/AVFoundation (0x16aea4bc). One of the two will be used. Which one is undefined.
Then my URLSession code stops working
2020-01-13 22:50:12.430920+0100 MyAppWatch WatchKit Extension[45250:2099229] Task <3CECDE81-59B9-4EDE-A4ED-1BA173646037>.<1> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://myapp.com/def.json, NSErrorFailingURLStringKey=https://myapp.com/def.json, NSLocalizedDescription=cancelled}
It works perfectly on watchOS 6.0 and before, this is probably due to URLSession classes conflicts. How to solve this?

Xamarin Forms OAuth2 Error Target of Invoke is null

After solving this problem I ran into another.
I changed the NuGet-package and implemented everything as described here.
I also added the initialization code in the AppDelegate.cs. But if I push the button to login I get the following error message: Uncaught Exception: Target of Invoke is null (NullReferenceException).
What I've done so far:
Create OAuth2Authenticator with appropriate values
Add Event handler authenticator.Completed += OnAuthCompleted;`
Initialized platform specific login UI with global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init(); and global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, bundle);
Triggered the login with:
var presenter = new Xamarin.Auth.Presenters.OAuthLoginPresenter();
presenter.Login(authenticator);`
I'm using the Xamarin Live Player to deploy this on my iPhone.
Some ideas how to fix this?
UPDATE:
I was able to test the app with a Android emulator and there is everything working. So my assumption is that it's because of the Xamarin Live Player.

Game Center not authenticating using Swift

I'm trying to authenticate the local player using swift, but every time I get a false value for the .authenticated property. Here is the code I'm using, it is called by the main view controller when the app starts.
func authenticateLocalPlayer(){
var localPlayer = GKLocalPlayer()
localPlayer.authenticateHandler = {(viewController, error) -> Void in
if viewController {
self.presentViewController(viewController, animated: true, completion: nil)
}else{
println((GKLocalPlayer().authenticated))
}
}
}
It brings up the log in view just fine, but when I enter a test account login, it just returns the GKLocalPlayer().authenticatedas false. The bundle identifier in iTunes Connect and the info.plist are exactly the same, as is the version and the app name. Everything is enabled for Game Center on iTunes Connect and in Xcode, but I have a feeling it's not a coding error, it's a setup error in the app record somewhere but I can't for the life of me find where.
After further tinkering, I'm getting this error:
Error Domain=GKErrorDomain Code=15 "The requested operation could not be completed because this application is not recognized by Game Center." UserInfo=0x17006b300 {NSLocalizedDescription=The requested operation could not be completed because this application is not recognized by Game Center.}
I have no idea why this is the case, the bundle ID, name and versions all match...
Any help would be greatly appreciated.
This issue has been resolved by Apple - just call:
GKLocalPlayer.localPlayer()
Previously, the issue was that GKLocalPlayer() does not return the GKLocalPlayer singleton, but instead returns a new GKLocalPlayer instance.
If you were on the Xcode 6 BETA, you could add a C function or Objective-C method that returns the real GKLocalPlayer singleton, then use this in Swift. This is the gist of my workaround (with bad naming conventions):
In an Objective-C header:
GKLocalPlayer *getLocalPlayer(void);
In an Objective-C implementation:
GKLocalPlayer *getLocalPlayer(void) {
return [GKLocalPlayer localPlayer];
}
In your bridging header:
#import "ThatHeader.h"
Then whenever you need to access the GKLocalPlayer singleton in Swift, you can just use getLocalPlayer() instead of GKLocalPlayer(). It's probably a better idea to stick that in an method of a GKLocalPlayer category.
However, this is no longer necessary as detailed above.
Even with Xcode 6 Beta 6, on a device using iOS 8 beta 5, making GKLocalPlayer.localPlayer() available, I was still getting the error:
"NSLocalizedDescription=The requested operation could not be completed
because this application is not recognized by Game Centre"
The solution (discovered through Apple's Dev forum) was to go to "Settings" on the device, and then into "Game Centre" and enable "Sandbox" under the developer section.
You can use that, I create a simple class for iOS game center in GitHub
Easy Class Game Center Swift
https://github.com/DaRkD0G/Easy-Game-Center-Swift

PhoneGap (iOS) (xcode v.4.3.3) - Errors building project to app simulator

Hello stackoverflow members,
This is my first time using PhoneGap, and after creating a project "Hello World", and opening it with Xcode, I get these build errors when I try to run it in the simulator:
Unknown type name '_commandQueue'; did you mean 'CDVCommandQueue'?
Expected identifier or '('
Unknown receiver '_commandQueue'; did you mean 'CDVCommandQueue'?
No known class method for selector 'resetRequestId'
Unknown receiver '_commandQueue'; did you mean 'CDVCommandQueue'?
No known class method for selector 'fetchCommandsFromJs'
Unknown receiver '_commandQueue'; did you mean 'CDVCommandQueue'?
No known class method for selector 'dispose'
Property 'commandQueue' requires method 'commandQueue' to be defined - use #synthesize, #dynamic or provide a method implementation in this class implementation
Does anyone here have an idea of how to fix these errors by any chance?
I am using Xcode v4.3.3 and the latest version of PhoneGap.
Thank you for your time,
Jonathan.
Add the line
#synthesize commandQueue = _commandQueue;
before the __init method and rebuild.

NSURLConnection fails after upgrade to iOS 5

I have a very simple NSURLConnection call that works perfectly in all iOS versions except iOS 5. Since this is a 'sendSynchronousRequest' call, there are no NSURL delegates declared anywhere in the app (the response should come directly back to this method call). Also, because this is a sendSynchronousRequest, there are no 'didReceiveData' or other NSURL-associated methods implemented in the app.
Here is the offending line of code:
NSData *response = [NSURLConnection sendSynchronousRequest: serviceRequest returningResponse:nil error:nil];
When I step through the code in the debugger, I can confirm that app is sending the request, and that the server is receiving the request. I can also confirm that the server is then sending a response back to the client.
This was all working perfectly until I upgraded to iOS 5. Now, after the update to iOS5, the NSData variable (response) is never receiving anything and always comes back with 0 bytes.
Other than the update to iOS5, there have been no code changes at all.
There were several changes made to the NSURLConnection class in iOS 5. In particular, several delegate methods that were deprecated. I experienced a similar issue and it was caused by one of the delegate methods no longer being called. If this sounds like your issue, take a look at the formal delegate protocols NSURLConnectionDelegate and NSURLConnectionDataDelegate.
I had the same problem using a custom Web server. The problem turned out to be an invalid header in the response. I changed:
HTTP/1.1 200/OK
to:
HTTP/1.1 200 OK
iOS 5 now accepts the response. Check your packet capture. You may have the same or similar problem.

Resources