1

I'm using RubyMotion to build an iOS app.

I am using Facebook and Parse.

I have set up three different Facebook and Parse applications.

How should I set up RubyMotion to use the correct credentials for each app for each environment? Is using yml files correct? If so where should I put them and how should I load them.

Are there things like development.rb in rails?

Daniel X Moore
  • 14,637
  • 17
  • 80
  • 92

1 Answers1

5

It's possible to differentiate between at least two versions, I know.

In your Rakefile you can use app.X to specify different things:

  # Distribution - use rake archive:release
  app.release do
    # Release (production) items here
  end

  # Development - use rake archive
  app.development do
    # Dev stuff here
  end

Elsewhere, to differentiate I use this:

def development?
  RUBYMOTION_ENV == "development"
end

def release?
  !development?
end

def parse_app_id
  return "PARSE_DEVELOPMENT_APP_ID" if development?
  return "PARSE_RELEASE_APP_ID" if release?
end

def parse_client_key
  return "PARSE_DEVELOPMENT_CLIENT_KEY" if development?
  return "PARSE_RELEASE_CLIENT_KEY" if release?
end

I also keep a Testflight branch in my git repo that has Testflight packages and info (that I never merge back into master or dev) but that's beyond the scope of my answer here.

Jamon Holmgren
  • 23,738
  • 6
  • 59
  • 75