I'm building an app and I'd like to use Wordpress as the backend for my users. For example, I want my app user to be able to login to their account that they registered on my Wordpress site, and then post to and from it from my native application. Does Wordpress have a swift SDK that allows me to do this?
You need to make REST requests and auth too. Take a look here https://wpengine.com/resources/using-wordpress-rest-api-plugin/
On Swift side you can use Alamofire for communication.
Also if you want more API routes you should install some of API/REST WP plugin
Related
hi I am new to react native but I wish to connect my iOS app with the phpmyadmin database anyone can share the idea how should I do. thanks a lot
You mean MYSQL database. You can use PHP to create and serve a REST API which you can access from React Native with Fetch or Axios. I've done this on many IOS apps and web apps. You can also use existing frameworks or CMS systems that have a built in rest API, like Laravel or Wordpress.
Build your own:
How to write a REST API?
Laravel:
https://laravel.com/docs/9.x/eloquent-resources
Wordpress:
https://developer.wordpress.org/rest-api/
More on REST API's:
What exactly is RESTful programming?
I am trying to understand how I can authenticate my iOS app using github. I understand from the documentation, that I need to implement this using OAuth.
I also understood that in my github profile, I need to register a new OAuth application, the form to do that looks like this:
I don't understand what info I have to provide for Homepage URL and Authorization callback URL as I am building an iOS app and not a webapp that is actually hosted on some server.
I would suggest trying FireBase. It has an infrastructure to enable GitHub login specifically. Also, there are sufficient examples to create the app.
I'm creating an iPhone app that will allow users to log in with Twitter and for the app to then be able to post on their behalf.
Is it better to make post requests to Twitter from the app or from the server? Why?
For my app I found it easier to do it on the client. If you are looking for a iOS twitter library I have it here https://github.com/narup/PSTwitterEngine Though, you can still post using iOS native twitter support. You will need this library if you are using browser based authentication
Also, didn't want to write extra code on server since i am writing server myself :)
I am developing IOS app where users will be login into my WordPress site and complete the form and send the data to WordPress Database. Here I am using JSON API for Wordpress to validate users. Is there any plugin which allow me to enter data to WP database directly?
You can use the JSON API to add a post to Wordpress. You do have to implement Oauth2 if you want to do so. You could use one of these libraries for that: https://cocoapods.org/?q=oauth
See the API documentation for information about posting something: https://developer.wordpress.com/docs/api/
I am trying to create an ios App that talks to a backend API written in nodejs. The backend also has an accompanying webapp also written in nodejs. The idea is that you can login (using facebook-js) on either the app or the webapp and post things to to.
My question is this, let's say that the user decided to login using the ios App, then call some backend API method to post an article, how do I make this work without essentially forcing the user to login twice?
Not sure if I'm making sense, any help would be greatly appreciated!
As Facebook uses OAuth for the client authentication, it's relatively easy to store the Access Token resulting from the login process somewhere on your server, and use them later.
Have a look at Design for Facebook authentication in an iOS app that also accesses a secured web service
Also, see https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.1 which outlines the login process and the storage of Access Tokens.