0

I’m trying to implement parse functionality in a app extension. The main app uses Parse to push and retrieve data. The problem is I can't install the parse SDK to my app extension. Is this even possible? I've been on google for about three hours and I’m starting to think not. I've tried to init another pod file and I’ve tried the the abstract_target function. No matter what I do, I can't seem to import it. Has anyone achieved this before? Im using swift 2.0 if that helps.

If there is another way to carry out the following, please let me know:

(This happens in the share popup view)

1.Grab user input text

2.Push it to the parse backend

  • 2
    I'd highly reccomend moving away from Parse. Since it's shutting down early next year, I wouldn't advise starting an app with it right now. If you're looking for a good database server, Firebase works really well for me. – Bryan Jul 31 '16 at 23:22
  • Agree with @Bawpotter. Parse should be avoided. – TheValyreanGroup Jul 31 '16 at 23:26
  • @Bawpotter I agree also, but since I am new to backend, I believe parse is a good introduction. I plan to remake the app with a firebase backend when finished. Also the backend is currently being hosted on heroku –  Jul 31 '16 at 23:38
  • While I get where you're coming from, I think you'll also have an easier time with Firebase (I don't work for them, I just love their product). The Parse docs and tutorials are pretty outdated, whereas the Firebase ones are really new. Also, Firebase is wayyy easier to set up (Having orginally used Parse for my apps). – Bryan Jul 31 '16 at 23:43
  • Well in that case @Bawpotter, do you know how to transfer data from the share extension to the main app or backend? –  Aug 01 '16 at 00:21
  • Unfortunately not, I stopped using them a long time ago, when they were running a different backend. Sorry! – Bryan Aug 01 '16 at 00:35
  • @Bawpotter parse is shutting down but they release their backend code to open source so all parse.com users can now take parse-server, deploy it to any cloud platform and continue to work as usual. They also created a migration tool which migrates your parse.com mongodb to self hosted/managed mongodb so i will not suggest to moving away from Parse. – Ran Hassid Aug 01 '16 at 05:57

1 Answers1

0

in order to use Parse ios SDK in your app extension you are require to do the following:

  1. enable local data store (local data store is where your data is being saved locally on your device)
  2. Enable app groups and keychain sharing in both of your targets (your main app and your extension) this allows you to share the data and the session between your app and your extension.

When i did it. I follow this guide which explain how to integrate apple watch and app extension with parse IOS SDK.

If you are using CocoaPods in your project please make sure that you load the Parse pod also to your extension.. so let's assume that the only pod that you have in your Podfile is pod 'Parse' you Podfile should look like the following

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

def my_pods

pod 'Parse'

end



# Change the MainAppTargetName to your main app target
target 'MainAppTargetName' do  
    my_pods
end

# change MyExtensionTargetName to your extension target name
target 'MyExtensionTargetName' do
    my_pods
end
evan.stoddard
  • 698
  • 1
  • 5
  • 22
Ran Hassid
  • 2,788
  • 1
  • 12
  • 20
  • Thank you so Much! One question. When it says _"Add the following before you initialize Parse in your main app:"_, Where should I put it, in the app delegate? @Ran –  Aug 01 '16 at 06:21
  • Yes . in the same place where you call Parse.initialize but please make sure you call it before calling to initialize – Ran Hassid Aug 01 '16 at 06:22
  • i assume that you are using cocoapods ... that is correct? – Ran Hassid Aug 01 '16 at 06:33
  • No! it's great :) i will update the answer and show you how to do it for cocoapods – Ran Hassid Aug 01 '16 at 06:34
  • Thank you, I have followed the directions but I still get an error : "No such Module". Its strange, Because your answer seemed perfectly logical. Ive cleaned it, built it, re-installed and updated the pods, manually linked it to the binaries section, but to no avail. –  Aug 01 '16 at 07:11
  • did you run pod install after changing the Podfile ? – Ran Hassid Aug 01 '16 at 07:22