Creating your own iOS App using Cloud SDK & Device Setup Library

Does anyone know where there is a proper, up-to-date tutorial for creating your own iOS App using the Cloud SDK and Device Setup Library?

I’ve been trying to follow the official tutorial from here (https://docs.particle.io/guide/how-to-build-a-product/mobile-app/#how-to-get-started-), as well as user guides from other community members, but I keep getting stumped with numerous errors and no documented troubleshooting information to follow.

I am literally just trying to do the bare minimum of authenticating and setting up my device. I’m using Xcode 6.2 and my minimum target platform is iOS 8.2. I am also coding in Objective-C. I followed the instructions to set up Cocoapods, and it appears the dependencies needed were download properly. However one of the errors I receive refers to “SparkSetup.h” cannot be found, and there are many others. I’ve even tried using the already created iOS example app, but that keeps throwing errors too. I’ve included some screenshots of these errors.

Any help is greatly appreciated as this is becoming very frustrating. I took iOS app development in school over a year ago, so this is my first project that I’m trying to attempt.

Thanks!

Can you describe how you installed the Particle SDK in your project?
(also post your Podfile if you chose to use Cocoapods)

Also is there a good reason for using such an old version of XCode?
I am not sure I can provide support for XCode 6. Unless there’s a good reason - please update to latest XCode (8.2.1 AFAIK).

@ido I’m having difficulties with this too. I followed the following steps

  1. Created a new Xcode project in Xcode 8.2.1, then closed Xcode
  2. In Terminal, navigated to the root folder of the project, and typed pod init to create the pod file
  3. edited the pod file in Xcode so it contained only “Spark-SDK”
  4. typed in pod install

here is the terminal output

Erics-iMac:~ janicedelmar$ cd PodTest272
Erics-iMac:PodTest272 janicedelmar$ pwd
/Users/janicedelmar/PodTest272
Erics-iMac:PodTest272 janicedelmar$ pod init
Erics-iMac:PodTest272 janicedelmar$ open -a Xcode Podfile
Erics-iMac:PodTest272 janicedelmar$ pod install
Analyzing dependencies
[!] The dependency Spark-SDK is not used in any concrete target.

I don’t know what that error message means. I’m not getting any .xcworkspace file created in my folder.

I think that error means your Spark-SDK is not in a target specification. For example, I used this in Podfile. I think you’d substitute PodTest272 for SDKTest1, and optionally leave out SparkSetup if you didn’t need that.

target 'SDKTest1' do
  pod "Spark-SDK"
  pod "SparkSetup"
  pod 'AFNetworking', '~> 3.0'
end
1 Like

Thanks Rick, that worked perfectly. Is there a reason that the target and the AFNetworking statements use single quotes instead of double ones? Trying to follow the instructions to add the Particle SDK is quite frustrating; the instructions in the docs say, “simply add the following line [pod “Spark-SDK” ] to your Podfile on main project folder:” It’s not clear from that statement if that’s the only thing that should be in the file. I was following more detailed instructions from a 2015 post (here). In that post @ido stated that pod “Spark-SDK” should be the only line in the file, and the OP also stated that in his summary; those instructions appeared to have worked at that time, so I’m guessing that something has changed since then.

It could be a change in how the Podfile works; I’m not sure. The only reason I happened to know this is that I ran across the not a concrete target error trying to solve a different problem yesterday. Since I guessed the fix from copying things from two different sources the quotes are mixed; they probably should be all the same but I don’t think it matters which one you choose.

I can confirm that the Podfile works with either single or double quotes. It also appears that you don’t need a separate line for AFNetworking. It installs AFNetworking 3.1.0 with or without that line. The only difference I see is what the “sending stats” line says in the terminal

With the AFNetworking line: There are 3 dependencies from the Podfile and 4 total pods installed.

Without the AFNetwoking line: There are 2 dependencies from the Podfile and 4 total pods installed.

All the same files are present in the project folder.

1 Like
  • Indeed Cocoapods recently changed the behaviour and requirements of the Podfile - I do need to update the docs and examples. target directive must be included now.
  • Quotes or double quotes - same thing in Podfile
  • No need to include AFNetworking implicitliy - it will be included anyway by Spark-SDK
  • Thanks @rickkas7 for providing the solution
  • @Ric Let me know if you encounter any other issues

@ido I installed Cocoapods first using sudo gem install cocoapods which installed successfully.
From there I created a new Xcode project and placed the Podile in the project directory.
(Below are the contents of my Podfile)

  target 'Wireless Bed Control' do
     pod "Spark-SDK"
     pod "SparkSetup"
     pod 'AFNetworking', '~> 3.0'
end

After typing pod install I would get the following output:

Pod installation complete! There are 3 dependencies from the Podfile and 4 total pods installed.

I am using an older version of Xcode to retain some backwards compatibility. My other development Macs run OS X 10.9.5 which doesn’t support Xcode 8.2.1. I do have Xcode 8.2.1 installed on a newer system, however I would like to keep my workflow accessible on the other machines as well.

What is the minimum Xcode version that Particle supports?

Looks like you installed everything correctly.
I think XCode 7 should work fine, be aware however that AFAIK Apple won’t accept apps uploaded by XCode 6, so it’s not much of what Particle supports rather it is what Apple accepts as minimum version.

@Ric and @rickkas7 - I updated the READMEs in the iOS repos with the updated info on the Podfile format.

@ido I am now trying Xcode 8. I followed all the same steps for creating the project and setting up the dependencies. I open the xcworkspace file and build the project (as is) without making any changes, and after a successful compile a message pops up saying the info.plist cannot be found.

The iOS Simulator opens, but no app is there.

I used a YouTube video a while back to assist with setup. I don’t know if the instruction will address some of the problems mentioned in this thread but it does a thorough job of explaining the process.

" https://m.youtube.com/watch?v=_aotVQGhPH8 "

Roger