.or query in parse unity crashes on iOS - ios

I'm doing a .or query which in every platform works fine except in iOS.
As soon it reaches the line where it does the .or, it crashes with:
System.Collections.Generic.List> doesn't implement interface System.Collections.Generic.IEnumerable>
Assertion: should not be reached at mini-trampolines.c:183
Here's the code:
var isChallenger = ParseObject.GetQuery("Match")
.WhereEqualTo("Challenger",fb.loggedUser);
var isChallenged = ParseObject.GetQuery("Match")
.WhereEqualTo("Challenged",fb.loggedUser);
ParseQuery<ParseObject> query = isChallenger.Or (isChallenged); // Crashes here.
I'm doing it just like in the docs, not sure what's wrong.
Any help would be much appreciated!
Thanks,
Pablo

I think this is a bug I reported here: https://developers.facebook.com/bugs/750897958275392/
Except, I only saw this bug when using ParseQuery. The workaround I used is to use ParseQuery only, but I see you're already doing that. Is the code you posted exactly the same as the code you're actually using?

Related

Sentry error - IndexSizeError: The index is not in the allowed range

I am getting this error from Sentry repetitively in ios - safari 14.0 in react project.
There is no code trace and no other information than this but it repeats in almost every URL.
I have already searched for the options everywhere. I have tried debugging but I can't replicate it, and so I can't resolve it.
Does anyone know what does this error means? Or how can I add debug information in Sentry?
I have been looking for the solution for a while and couldn't get it. I know it's a bit lack of information to provide but that's why I am asking this. if someone can tell me how to deal with sentry errors if you don't know why it is repeating so often, it will be really helpful.
A similar issue still exists.
Faced this in Safari when Draft.js is updating the editor state.
The error which I see: IndexSizeError: The index is not in the allowed range.
For me, playing around with Paragraph Directioncontext menus items after right-clicking on the Editor selection reproduced the error.
My Solution/hack:
Add it to any JS file executing before the Editor file.
const nativeSelectionExtend = Selection.prototype.extend;
Selection.prototype.extend = function (...args) {
try {
return nativeSelectionExtend.apply(this, args);
} catch (error) {
console.log('Selection error.', error);
}
};
It works properly for me. Maybe will be useful for somebody as well.
Thanks to https://github.com/shpakkdv

Skobbler background mode without SKTNavigationManager

I'm developing an IOS app in swift language with the Skobbler navigation SDK.
I try to allow the user to use navigation while in background mode (IPhone locked).
I have question stated below :
1) Is it possible to do so without using the SDKTools and the SKTNavigationManager ? We only use SKMaps.frameworks functions.
With this configuration, I can't use the allowBackgroundNavigation
property of SKTNavigationConfiguration like in the demo.
I set
SKPositionerService.sharedInstance().worksInBackground = true
and allowed the "location Update in BackgroundMode" to the info.plist. Unfortunately the updateCurrentLocation doesn't triggered in background and navigation doesn't works neither.
Thank you very much in advance :-) !!
P.S. : I succeeded to run a short code in background with the official library CCLocationManager. So my app seems correctly configured...
The hotfix for this issue can be downloaded from here:
ObjC: https://www.dropbox.com/s/ruk6at2fju0rdd7/SKMaps_2_5_1.zip?dl=0
Swift: https://www.dropbox.com/s/lgbdherhqzudy2a/SKMapsSwift_2_5_1.zip?dl=0
Sorry..this is not an answer, but a "Same Problem". updatedCurrentLocation is not called when the app is in the background.
Thought I add some more code to give more info and perhaps find the cause:
My code:
SKPositionerService.sharedInstance().delegate = self
SKPositionerService.sharedInstance().worksInBackground = true
SKPositionerService.sharedInstance().automaticLocationUpdatePause = false
SKPositionerService.sharedInstance().startLocationUpdate()
Also tried putting SKPositionerService.sharedInstance().startLocationUpdate() as first line. No luck.
When I run a CLLocationManager alongside the SKPositionerService like so:
locManager = CLLocationManager()
locManager.desiredAccuracy = 10000
locManager.distanceFilter = 10000
locManager.allowsBackgroundLocationUpdates = true
locManager.pausesLocationUpdatesAutomatically = false
locManager.startUpdatingLocation()
updatedCurrentLocation IS being called while in background.
I used this when I was running 2.5.0 as that version was not yet iOS9 ready, but I thought that 2.5.1 would be. This of course is a horrible workaround as a 2nd locationmanager eats battery.
Could it be that, in the SKPositionerService implementation, you are not setting CLLocationManager().allowsBackgroundLocationUpdates to true when SKPositionerService.sharedInstance().worksInBackground is set to true?
btw I'm running the 2.5.1 hot fix posted here.
btw2: This can not be tested in the simulator. The simulator will call updatedCurrentLocation even when the app is 'backgrounded'. I'm guessing because the simulator doesn't really have a 'background' mode.
btw3: I would be very surprised if background mode works for the SDKTools Navigation Manager... with this 2.5.1. hot fix)

Firebase childbyAutoId returns the same strange key every time

When using childByAutoId, something really strange happens. Instead of getting a unique id, I get the following key every time:
-------------------0
I know keys are generated with client side timestamps, so I tried running my code through the iOS simulator and an actual device, same result though.
I don't do anything interesting in my code, but here it is for reference:
func sendRandomMessage() {
let firebaseRootRef = Firebase(url:firebaseRootUrl)
let newMessageRef = firebaseRootRef.childByAutoId()
println(newMessageRef.key)
}
I'm using Firebase 2.3.0
There was a bug in the Firebase SDK for iOS 2.3.0 that caused this problem.
It has been fixed in 2.3.1. See https://www.firebase.com/docs/ios/changelog.html

Google Analytics Integration in SWIFT

Im trying to integrate Google Analytics in SWIFT. I used this user guide and tried to do in SWIFt. But I'm having hard time since this is the first time using Google Analytics. Is there any tutorial/resource for SWIFT ? Thanks in advance.
Edit1: Procedure and code I have used,
1. Added the google headers in bridging-header file
2. Added these in Appdelegate
GAI.sharedInstance().trackUncaughtExceptions = true
GAI.sharedInstance().dispatchInterval = 20
GAI.sharedInstance().trackerWithTrackingId("UA-XXXX-YY")
3. Gave the screen name in viewDidAppear as self.screenName = "Game Screen"
4. Created an event as
var tracker = GAI.sharedInstance().trackerWithTrackingId("UA-XXXX-YY")
tracker.send(GAIDictionaryBuilder.createEventWithCategory("SolveGame", action: "GameSolved", label: "Solve", value: nil).build())
I know I'm late, but I was in a similar situation today - not knowing much about Google Analytics and trying to implement it in Swift, for which there's little help online yet. I got it working with basically the same code you have shown here. One suggestion: If you also set
GAI.sharedInstance().logger.logLevel = GAILogLevel.Verbose
You may get some useful messaging in the console.
One other minor point is that I'm calling trackerWithTrackingId() first, before the other calls. Not sure if order matters.
Also, I'm assuming from your point #3 that you're implementing GAITrackedViewController, but figured I would mention that anyway as a tip.
And one final sanity check - you are using your actual tracking id, rather than "UA-XXXX-YY" in your code, right?
I just had to deal with this. I used both the demo provided AND integrated it into my app.
Nothing. 0s.
Then I came in this morning to take a look. It was working this morning. So evidently there is a good bit of lag before this aspect of Google Analytics kicks in.
As for your event tracking, that should work if you are tracking events, however that isn't how you would track a given page.
Assuming that want to track pages to you would want to use something like this.
var storyboardViewName = "Lender-Details-View"
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
// [START GOOGLE ANALYTICS]
var tracker = GAI.sharedInstance().defaultTracker
tracker.set(kGAIScreenName, value: storyboardViewName)
var builder = GAIDictionaryBuilder.createScreenView()
tracker.send(builder.build() as [NSObject : AnyObject])
// [END GOOGLE ANALYTICS]
//.... other code here .....
}

NSFileManager leads to SourceKit Service Terminated

It's totally confusing on using this line
var docContents : NSArray! = NSFileManager.defaultManager().contentsOfDirectoryAtPath(archieveDirectoryPath,error:
&err)
I get the alert like SourceKit Service Terminated Editor Functionality temporary limited continuously, and gone swift coding style. But When I comment this line, all are disappeared.
Any one experienced this or is this a common error?
Note: I've tried this post's answer, But won't work. Just comment that line, it gets work. But I need that line. I'm using Xcode-6-beta-2
Finally fixed by below code. I think, it may common error. Just replace ! with ? symbol.
var docContents : NSArray? = NSFileManager.defaultManager().contentsOfDirectoryAtPath(archieveDirectoryPath,error:
&err)
But I didn't see any docs related how this happen. If anybody know, let me know. I think, this may temporary workaround.

Resources