Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iphone 5 and 4s can't fetch data #2423

Closed
mkaya93 opened this issue Jul 30, 2016 · 9 comments
Closed

iphone 5 and 4s can't fetch data #2423

mkaya93 opened this issue Jul 30, 2016 · 9 comments

Comments

@mkaya93
Copy link

mkaya93 commented Jul 30, 2016

last version of parse
self hosted on azure

Problem is on iPhone 4s and 5 I can't fetch data's.But in other devices its works.Also I can make login process and some other queries too. Also that's not giving me an error.

This is my code

let query = PFQuery(className: "Activity")
        query.orderByDescending("createdAt")
        query.whereKey("members", equalTo: PFUser.currentUser()!)
        query.whereKey("fromUser", notEqualTo: PFUser.currentUser()!)
        query.includeKey("fromUser")
        query.includeKey("members")
        query.whereKey("Type", notEqualTo: "joinToBons")
        query.includeKey("friends_request")
        query.includeKey("group")
        self.label = UILabel(frame: CGRectMake(0, self.tableView.frame.size.height / 2, self.view.frame.size.width, 20))

        query.findObjectsInBackgroundWithBlock { (object, error) in
            self.label.removeFromSuperview()
            if error == nil {
                self.notifications = object!
                if object?.count == 0 {
                    self.dataAvailable = false
                    self.label.center = self.tableView.center
                    self.label.textAlignment = .Center
                    self.label.text = "nonotification".localized()
                    self.notifications.removeAll()
                    self.view.addSubview(self.label)

                }else {
                    self.label.performSelectorOnMainThread(#selector(self.label.removeFromSuperview), withObject: nil, waitUntilDone: false)
                    self.label.removeFromSuperview()
                    self.label.hidden = true
                    self.label.text = ""
                    self.dataAvailable = true
                }
            }else {
                print(error)
            }
            self.view.setNeedsLayout()
            self.loader.hideActivityIndicatorWithAnimation(self.view)
            self.tableView.reloadData()
            self.refreshControl?.endRefreshing()
        }

@ranhsd
Copy link
Contributor

ranhsd commented Jul 31, 2016

Hi @mkaya93 do you get any logs in xcode? I don't see any reason why it will not work on iPhone 4/5 but on other devices it will work.

@hramos
Copy link
Contributor

hramos commented Aug 1, 2016

We are closing this issue due to a lack of sufficient information.

Please refer to this issue for an example of a great bug report.

You may use Server Fault for questions about managing Parse Server.

For code-level and/or implementation-related questions or technical support, please refer to Stack Overflow.

@hramos hramos closed this as completed Aug 1, 2016
@bhirshman1
Copy link

I'm experiencing the same problem. Did you figure out why this was happening?

@flovilmart
Copy link
Contributor

HTTPS issue? HTTP issue? ATS?

@bhirshman1
Copy link

Thank you for the quick response!

I have an app created in Swift running on parse server hosted by Heroku. When the app runs on iPhone 5s or newer (in the Xcode simulator and in real life), a query finds objects. Only on the iPhone 5 does the same query not find objects. Is there any reason for this that you can think of? The iOS versions are the same in each case.

@flovilmart
Copy link
Contributor

Can you use the request interceptor? Probably that may help.

Are the queries received on the server? You can turn on verbose logging with setting the VERBOSE=1 env. variable

@mkaya93
Copy link
Author

mkaya93 commented Apr 13, 2017

Hi @bhirshman1,

I was just changed query and its worked properly. But I'm not remembering which parts I changed on query.

@bhirshman1
Copy link

Interesting...

You recall experiencing the same thing I am though? Your query yielded no objects when using an iPhone 5, yet found objects when using a 5s, 6, etc.? Quite honestly we might be the only 2 people ever to experience this, considering I can't find anything else on the internet mentioning it.

@bhirshman1
Copy link

So it turns out that iPhone 5s and newer are 64-bit devices, as opposed to 32-bit for iPhone 5 and older. 32-bit devices can't successfully query when a key is an array. My explanation I'm sure isn't the most technically sophisticated. It's explained better in the below links. Seems the only solution at the moment is a work around on the server side, which i'm hesitant to do.

parse-community/Parse-SDK-iOS-OSX#1067

#3169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants