Giter Club home page Giter Club logo

wordpress-ios's Introduction

WordPress for iOS

CircleCI Reviewed by Hound

Build Instructions

Please refer to the sections below for more detailed information. The instructions assume the work is performed from a command line.

  1. Download and install Xcode. WordPress for iOS requires Xcode 11.2.1 or newer.
  2. From a command line, git clone [email protected]:wordpress-mobile/WordPress-iOS.git in the folder of your preference.
  3. cd WordPress-iOS to enter the working directory.
  4. rake dependencies to install all dependencies required to run the project (this may take some time to complete).
  5. rake xcode to open the project in Xcode.
  6. Compile and run the app on a device or an simulator.

In order to login to WordPress.com using the app:

  1. Create a WordPress.com account at https://wordpress.com/start/user (if you don't already have one).
  2. Create an application at https://developer.wordpress.com/apps/.
  3. Set "Redirect URLs"= https://localhost and "Type" = Native and click "Create" then "Update".
  4. Copy the Client ID and Client Secret from the OAuth Information.
  5. From a command line, ensure you are in the project's working directory and run cp WordPress/Credentials/wpcom_app_credentials-example .configure-files/wpcom_app_credentials to copy the sample credentials file.
  6. Open the newly copied .configure-files/wpcom_app_credentials with the text editor of your choice, and replace WPCOM_APP_ID and WPCOM_APP_SECRET with the Client ID and Client Secret of the application you created. Note that .configure-files will be hidden by default in Finder. If you need to view it in Finder, hold down Control+Shift+. and it should appear.
  7. Recompile and run the app on a device or an simulator.

You can only log in with the WordPress.com account that you used to create the WordPress application.

Third party tools

We use a few tools to help with development. Running rake dependencies will configure them for you.

CocoaPods

WordPress for iOS uses CocoaPods to manage third party libraries.
Third party libraries and resources managed by CocoaPods will be installed by the rake dependencies command above.

SwiftLint

We use SwiftLint to enforce a common style for Swift code. The app should build and work without it, but if you plan to write code, you are encouraged to install it. No commit should have lint warnings or errors.

You can set up a Git pre-commit hook to run SwiftLint automatically when committing by running:

rake git:install_hooks

This is the recommended way to include SwiftLint in your workflow, as it catches lint issues locally before your code makes its way to Github.

Alternately, a SwiftLint scheme is exposed within the project; Xcode will show a warning if you don't have SwiftLint installed.

Finally, you can also run SwiftLint manually from the command line with:

rake lint

If your code has any style violations, you can try to automatically correct them by running:

rake lint:autocorrect

Otherwise you have to fix them manually.

Open Xcode

Launch the workspace by running the following from the command line:

rake xcode

This will ensure any dependencies are ready before launching Xcode.

You can also open the project by double clicking on WordPress.xcworkspace file, or launching Xcode and choose File > Open and browse to WordPress.xcworkspace.

Setup Credentials

In order to login to WordPress.com with the app you need to create an account over at the WordPress.com Developer Portal.

After you create an account you can create an application on the WordPress.com applications manager.

When creating your application, select "Native client" for the application type. The applications manager currently requires a "redirect URL", but this isn't used for mobile apps. Just use "https://localhost".

Your new application will have an associated client ID and a client secret key. These are used to authenticate the API calls made by your application.

Next, create a credential file. Start by copying the sample credentials file in your local repo by doing this:

cp WordPress/Credentials/wpcom_app_credentials-example .configure-files/wpcom_app_credentials

Then edit the WordPress/Credentials/wpcom_app_credentials-example file and change the WPCOM_APP_ID and WPCOM_APP_SECRET fields to the values of your application's client ID and client secret.

Now you can compile and run the app on a simulator and log in with a WordPress.com account. Note that authenticating to WordPress.com via Google is not supported in development builds of the app, only in the official release.

Remember the only WordPress.com account you will be able to login in with is the one used to create your client ID and client secret.

Read more about OAuth2 and the WordPress.com REST endpoint.

Contributing

Read our Contributing Guide to learn about reporting issues, contributing code, and more ways to contribute.

Security

If you happen to find a security vulnerability, we would appreciate you letting us know at https://hackerone.com/automattic and allowing us to respond before disclosing the issue publicly.

Getting in Touch

If you have questions about getting setup or just want to say hi, join the WordPress Slack and drop a message on the #mobile channel.

Resources

License

WordPress for iOS is an Open Source project covered by the GNU General Public License version 2.

wordpress-ios's People

Contributors

jleandroperez avatar aerych avatar koke avatar sergioestevao avatar scoutharris avatar ctarda avatar astralbodies avatar frosty avatar diegoreymendez avatar sendhil avatar kurzee avatar nheagy avatar danielebogo avatar elibud avatar bummytime avatar etoledom avatar loremattei avatar leandroalonso avatar jklausa avatar shiki avatar jkmassel avatar roundhill avatar kwonye avatar sabaranski avatar tomwitkin avatar mikejohnstn avatar bjtitus avatar jtreanor avatar oguzkocer avatar alexcurylo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.