Getting Started with DJI SDK development for iOS devices in 2022

In Mobile App Development

Getting Started with DJI SDK development for iOS devices in 2022 - read the full article about ios app development 2022, Mobile App Development and Native and cross-platform solutions from Mohamad Ghaith Alzin on Qualified.One
Mohamad Ghaith Alzin
Youtube Blogger

Hello everyone this is Ghaith. In this lesson,  we will see how we can start creating a new iOS application that uses the DJI SDK that we connect  to and get feedback on the registration status as it is the most important step if you want to  develop a fully integrated DJI mobile app. I got already my Xcode project  is opened here and a simulator.  Now if you initiate a new pod file and type inside  it. put DJI SDK iOS since we will be using this SDK the DJI SDK in our project so we need to  install it using Cocoapods so go ahead and create a new file project and place this line of code  or this line here and then go to your terminal to your project and then type pod install wait  a minute and then you will get your DJI SDK iOS integrated and installed in your project  now to make sure that the SDK is working you have to import it in your ViewController  and then build command build to see if the SDK is connecting are working  correctly in your environment yeah so the build is actually  succeeded now to communicate with the server DJI server we need a protocol  which is called DJISDKManagerDelegate if you want your view controller to follow this protocol you have to import  or follow these two functions I prefer putting them below the viewDidLoad  function for the time being we will not be using this function just ignore it and we will just be  depending on the result of this function which is it checking if we get back  an error or not so now we have to create another function that says register app in this function here we will be  calling the DJI SDK manager and saying register app on this view controller now if you  check this function explanation it says the first time the app is initialized after installation the  app connects to a DJI server through the internet to verify the application key where is the  application key we dont have any application key yet we will be creating that in a few  seconds after we finish our code so first lets call this function from the viewDidload  here register app and after we call this register app function and the callback will be  in here and then we will get the result of the calling and after the DJI server will check for  us the DJI SDK app key if is not if it is matching correctly or not so we got the error now here we  will type some logic define a new of our message and inside this message well  say we will say register register app succeed maybe now if error is not equal to null what does that mean this means that if there is an error if we got an error then  we change the message context to register app field, please enter your app key in the Plist  file and check the network yeah else we could print out some statement  that says for example register success now lets create another function that will show a pop-up message for us  to show alert view for example with a with title uh for example lets say uh with title oh  sorry we have here definition with title and insight title of type string  and then with the message the inside message is also of type string and  inside logic here is about defining an alert of type UI alert controller with the  title the same title we pass here and miss a message the same message we pass  here and the preferred style is alert and let for example ok action we need action here  to close the pop-up message which is the UI alert action with a title for example okay and the style  default and here just nil for the handler now we can add for the alert controller a  new action which is ok action and then we can display this action on the screen we can say yeah of course the alert  animated to true and completion is nil now now if you run this app as it is we should get the  alert view function I will pop up an alert view with a without any success for the app key, yeah but here  first we have to call it here with the message and yeah with message sorry the message should  go here as the logic yeah and the title should be here, for example, lets say  uh lets say the title is register app run again yeah so it says register app field please  enter your app key in the Plist file and check the network so we dont have yet the,  okay we will do that we dont have yet the uh DJI SDK app key here so we have  to go to the website of the DJI you can get to the and register a  new developer account if you dont have one from here I already got my own so I will be creating a  new app under the SDK mobile SDK and the app name, for example, lets say test you can type  here whatever you want and choose ios where the bundle identifier should be  the same as this app bundle identifier so you can get it from here I guess yeah so  paste it here and then for the category you can choose whatever you want and here just type  test create one so after youre creating it the DJI will send you an email that has the  activation account or activation email that says just open it and you will  be redirected to this page after as you can see here if I refresh I will  get the app key so copy this app key and go to the info.plist and then just add this  key under something called DJI SDK app key and put it here sorry I will do it again DJI SDK  why Im getting s at the beginning DJI SDK app key and then  passed past this string here yeah make sure to type all of this capital  and then small double p and then the k is capital and then small e e y okay  and place this key here and run again now the communication should be yeah  done correctly register app is succeeded so this is the first lesson see  you in the next one thank you

Mohamad Ghaith Alzin: Getting Started with DJI SDK development for iOS devices in 2022 - Mobile App Development