Navigation Menu

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

watchOS 2 Support #179

Closed
17 tasks done
nlutsenko opened this issue Sep 6, 2015 · 46 comments
Closed
17 tasks done

watchOS 2 Support #179

nlutsenko opened this issue Sep 6, 2015 · 46 comments
Assignees
Labels
type:feature New feature or improvement of existing feature
Milestone

Comments

@nlutsenko
Copy link
Contributor

This issue is for tracking watchOS 2 support, mainly via Cocoapods.
To use the beta version of Parse SDK in your watchOS 2 app - add the following to your podfile:

pod 'Parse', :git => 'git@github.com:ParsePlatform/Parse-SDK-iOS-OSX.git', :branch => 'master'

We are aiming to get this very soon out, please comment here if you find any issues using Parse SDK with watchOS 2.

Implementation todo list:

  • Add basic target for watchOS 2 SDK (compiler warnings are ok, since we are not going to add this to tests just yet)
  • Decouple Reachability from PFEventuallyQueue/PFCommandCache/PFPinningEventuallyQueue (this is going to still be used for Analytics)
  • Disable ability to saveEventually/deleteEventually, since it doesn't quite make sense on the watchOS
  • Update PFDevice to use WatchKit APIs on watchOS
  • Update PFApplication to be a no-op on watchOS
  • Update PFLocationManager to use compatible APIs when running on watchOS
  • Disable extensions data sharing APIs (they don't work on watchOS)
  • Disable PFPush (at least for the first release)
  • Disable PFInstallation (at least for the first release, unless we build PushKit support)
  • Disable PFPurchase (no StoreKit support on watchOS)
  • Disable PFProduct (doesn't really make sense without PFPurchase)
  • Disable PFNetworkActivityIndicatorManager (no indicator on watchOS)
  • Add watchOS 2 SDK to Travis-CI just for building
  • Test all the things! (no XCTest for watchOS, bummer!)
  • Update podspec to include only watchOS specific things
  • Add watchOS starter project (optional)
  • Add watchOS 2 SDK to deployment packages

Development is happening in master, though we aren't going to ship the watchOS version until this list is finished.
If you want to play with Parse SDK for watchOS - simply compile the Parse-watchOS target available in Parse.xcworkspace.

This comment is constantly updating, sometimes without you noticing

@bmueller
Copy link

Also, could we please get support for PushKit when sending push notifications? PushKit is required to update watchOS 2 complications remotely via push notification.

@nlutsenko
Copy link
Contributor Author

As far as I can tell - there is not a whole lot of changes required between for the SDK itself to support PushKit, as we have already quite generic system to store device tokens, the only changes would be on the backend as well as in documentation.

I believe we can make it happen, though I would separate these and not block the generic release of watchOS 2 compatible SDK with PushKit.

@bmueller
Copy link

Awesome! Any chance this might happen before the final release next week?

@Perjan
Copy link

Perjan commented Sep 18, 2015

Hey @nlutsenko any news regarding watchOS2? Thanks.

@vvsokolov
Copy link

@nlutsenko, Any news ? Thanks.

@Ge0rges
Copy link

Ge0rges commented Sep 20, 2015

Any updates? Thank you.

@Baza207
Copy link

Baza207 commented Sep 21, 2015

@nlutsenko Is this getting a feature list drawn up along with the tvOS framework target? Would be really great to have a native watchOS Parse Framework, so we don't have to use WatchConnectivity to transfer data. Though I can imagine you've got your hands full at the moment with all these new platforms to sort out frameworks for. 😊

@nlutsenko
Copy link
Contributor Author

😁 Yup, we are in the process of compiling down a list of things we need to change/update to make watchOS 2 and tvOS versions of the framework happen.

@Baza207
Copy link

Baza207 commented Sep 21, 2015

@nlutsenko awesome. Good luck and keep up the good work. Great set of tools you guys got there. 😊

@nlutsenko
Copy link
Contributor Author

Hey everyone, I just put a list of all the things we identified so far and need to tackle before we can ship the watchOS version of the framework.
The list is going to be amended/changing as we go, but all of the pull requests are ultimately going to be attached to this issue.
The list is also serial, so we don't intend to tackle the problems at the end of the list, before the problems on the top are resolved.

@aldmitriev
Copy link

Hi, guys!
@mugu-trick did you resolved you issue?
How can I fix it too? Because my WatchOS 2 extension thinks about suicide, I try to help :)

target 'MainAppWatch Extension', :exclusive => true do
#  platform :watchos
# I tried to add watchos platform, but got a message about Watchos 2.0
  pod 'Parse'
  pod 'ParseUI'
  pod 'ParseFacebookUtilsV4'
  pod 'ParseTwitterUtils'
end

@mugu-trick
Copy link

Hey @aldmitriev sorry to say but sadly no :(

I ended up moving to Core Data, not saying is better or worse than Parse, but at least in my scenario it was the natural choice.

@aldmitriev
Copy link

@mugu-trick Thanks, man. I hope @nlutsenko will help with pods migration guide for all of us. Christmas and Black Friday are coming.

@deviggner
Copy link

Hi @nlutsenko ,
When the watchOS 2 compatible framework will be ready to download?

@nlutsenko
Copy link
Contributor Author

@aldmitriev @revolter I am using this podfile in my sample app that I use for testing:

use_frameworks!

target 'Sample', :exclusive => true do
  platform :ios, '8.0'
  pod 'Parse', :git => 'git@github.com:ParsePlatform/Parse-SDK-iOS-OSX.git', :branch => 'nlutsenko.watchOS'
  pod 'ParseUI'
end

target 'Sample WatchKit Extension', :exclusive => true do
  platform :watchos
  pod 'Parse', :git => 'git@github.com:ParsePlatform/Parse-SDK-iOS-OSX.git', :branch => 'nlutsenko.watchOS'
end

@deviggner We are still testing it, and you can jump right on it and help us out. (there are details in the first comment on this issue).

@aldmitriev
Copy link

@nlutsenko Thank you so much! Good job, Nikita! It's a good sample! I customized it. And It's working for me!
Maybe it's useful for somebody else:
Guys, comment "#use_frameworks!" if you're use Obj-C
If your pod install shows that:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

...You need to add ssh key if didn't https://help.github.com/articles/generating-ssh-keys/
Good luck!

@Ge0rges
Copy link

Ge0rges commented Nov 28, 2015

@aldmitriev @nlutsenko It previously worked for me once but recently doing a pod install shows the error you were mentioning:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I've checked my SSH keys, regenerated a new pair added them to githubs following the instructions at the provided link but I'm still getting this permission issue. Is it possible that their some permission issue on the repo side?

@aldmitriev
Copy link

@Ge0rges It should work. Something wrong with your steps. Delete key on github and try again. I guess you needn't customize your keys. Look at phrases "We strongly suggest". I ignored 2nd step and I had same issue:

We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.

Soo read it attentively and it'll work! Customize nothing

@Ge0rges
Copy link

Ge0rges commented Nov 28, 2015

It worked after running pod install instead of pod update for some reason.

Sent from my iPhone

On 28 Nov 2015, at 4:41 p.m., aldmitriev notifications@github.com wrote:

@Ge0rges It should work. Something wrong with your steps. Delete key on github and try again. I guess you needn't customize your keys. Look at phrases "We strongly suggest". I ignored 2nd step and I had same issue:

We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.

Soo read it attentively and it'll work! Customize nothing


Reply to this email directly or view it on GitHub.

@Vortec4800
Copy link

Is there more documentation about how to setup and use this somewhere? It seems like the only blurbs in the Parse Docs page refer to watchOS 1 and not 2 (telling you to use app groups, etc).

I'd like to know how to deal with PFUser and authentication, etc. I want to show my user's account data on their watch using the Parse SDK directly without going through the app, and I can't yet tell if this is even a possibility.

@richardneitzke
Copy link

@Vortec4800 I'm currently trying to get it working on my project. Can't really find a way to integrate it manually or via cocoapods.

@nlutsenko
Copy link
Contributor Author

@Vortec4800 @richardxyx Hey guys, here is the rough one:
For passing the user authentication between watch and phone - you would need to use a combination of WatchConnectivity.framework (built into the system) and your code to pass the session token from the phone to the watch (I recommend using a separate token from revocable sessions, as it's slightly more secure).

For installation - CocoaPods should work flawlessly, the only thing you would need to do is to specify the pod 'Parse' as a dependency for both your iOS app and WatchKit Extension.

If this fails for whatever reason and you don't really care about CocoaPods - I recommend using a pre-setup ParseStarterProject from releases page of this repo.

@brandinio
Copy link

@Vortec4800 I've got something working on my project. Probably not the best of solutions but it works nonetheless. If I find a better way of implementing this then I'll be sure to update my project accordingly. But what I have at the moment is that I get the iOS app to send the PFUser session token across to the watchOS app via WatchConnectivity, and then call the .become() method on the watch app with the session token being a parameter. It works. For now. If anyone else has a better solution please do let me know.

From my understanding, I don't think there is a way to authenticate directly from the watch app. I think it needs to be authenticated from the iOS app beforehand. Once authenticated from the iOS app, the watch app can then be untethered.

@nlutsenko
Copy link
Contributor Author

@brandinio, that is a perfect and very much intended solution..
If you take top most-used apps on the watch - you will find that most of them are quite unusable (or barely usable), unless you authenticate on your phone.

@richardneitzke
Copy link

@nlutsenko I'm trying to integrate Parse for WatchOS in my existing project via cocoapods. I tried nearly every combination for my podfile now and can't find any other resources online anymore.

When I'm getting you right, you just recommended using a podfile which looks like the following:

use_frameworks!

target 'Sample' do
platform :ios, ‘9.0’

pod 'Parse'

end

target 'Sample WatchKit Extension' do
platform :watchos

pod 'Parse'

end

which results in the following errors:

'Bolts/BFTask.h' file not found
Could not build Objective-C module 'Parse'

When I try other approaches, similar errors occur.

@nlutsenko
Copy link
Contributor Author

Super strange, as I've just tested with an empty project from scratch - and everything compiles like a charm. Attaching it here - YoloTest.zip

@richardneitzke
Copy link

@nlutsenko Thanks for testing. Seems like it works on new projects for me as well.

@Vortec4800
Copy link

@nlutsenko I'm setting up the revocable session as you described, and it seems like the sessionToken property is nil if I fetch it again later. Is that the case? Can I only access the sessionToken when the session is first created?

@Ge0rges
Copy link

Ge0rges commented Jan 23, 2016

How do you suggest we share data between the device and the watch through local datastore or group identifiers? I saw one of the items on your checklist is:

Disable extensions data sharing APIs (they don't work on watchOS)

@BananaFudgkins
Copy link

@Ge0rges for my watchOS app I used the WatchConnectivity API. It allows you to pass data between your iPhone and Apple Watch. I only used it for logging in the same user on their iPhone by passing the session token of the account on their iPhone and then using PFUser become on the watch. Queries and most other Parse functions can work on watchOS natively without having to run them on the iPhone and then pass them to the watch. Basically, if you need to pass data between an iPhone and an Apple Watch use the WatchConnectivity framework for that. I'd suggest looking up some tutorials about it. (Sorry about the long reply).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests