Gizwits App Framework (hereinafter referred to as Framework) is an open-source mobile application development framework developed based Gizwits App SDK to achieve the SDK loading, initialization, user registration, user login, device configuration, device discovery, device connection, device listing and other basic functions. The Framework is a source code project which is available to all developers and currently supports iOS and Android platforms. App developers can create a complete App by implementing specific product control pages based on the Framework.
This guide also comes with the source code of Gizwits Gokit App, which is an example project that employs the Framework and intended for developers to achieve a rapid development.
https://git.oschina.net/dantang/GizOpenSource_AppKit_iOS
https://git.oschina.net/dantang/GoKit_Demo_iOS
It can also be downloaded at the Download Center:
A. Library: Third-party library directory including GizWifiSDK
B. GizOpenSourceModules: contains
The default program entry is LoginViewController in UserModule. Gizwits AppID, AppSecret and program styles can be set in GOpenSourceModules/CommonModule/UIConfig.json file of the project.
If you use third-party authentication or push notification, it is important to ensure that the appropriate parameters are set to the same values as used in the corresponding platforms. If you use the push notification, you need to uncomment the related macro line in order to enable the corresponding type of push notification. If you don’t uncomment all the related macro lines, it means you are not using any third-party push notification at the time. Only one type of third-party push notifciation is supported at the same time, hence don’t uncomment multiple third-party push notification macro lines.
Configurable parameters are:
1) The code provided in the Framework project implements the redirection to the control page without any modification. You only need to focus on the logic of the operation pages. If you want to click a device in the device list page and jump to the view you created, modify the corresponding redirection parameters in the AppDelegate.m file. Please modify the imported header files and class definition of the target view as shown in the figure. If you use the blank page (GosDeviceController) provided by default to create the control page, you can skip this step.
2) Set the GizWifiDeviceDelegate in the control page, for example:
1 | self.device.delegate = self; |
3) Defining the delegate callback of the class in the control page to implement the GizWifiDeviceDelegate delegate method of the Gizwits App SDK:
1 | - (void)device:(GizWifiDevice *)device didReceiveData:(NSError *)result data:(NSDictionary *)data withSN:(NSNumber *)sn; |
It is used to receive the device state change notification reported by the Gizwits App SDK, which will be parsed in order to update the page.
4) To implement the command issuing, you need to call the interface method of the GizWifiDevice instance in the Gizwits App SDK:
1 | (void)write:(NSDictionary *)data withSN:(int)sn; |
For detailed parameter explanation, see the guide to Gizwits App SDK.
5) When exiting the control page, you need to unsubscribe from the current device, and call the interface method of the GizWifiDevice instance in the Gizwits App SDK with the parameter set to NO:
1 | - (void)setSubscribe:(BOOL)subscribed; |
If you need to add or modify an list item in the settings page, you need to update the GosSettingsViewController class file in the SettingsModule. Find and modify the delegate method of the UITableView in the .m file.
It supports iOS 7 and later systems currently.
The version number consists of two parts, the format is: project version number.program compilation time, where the project version number is set in the info, the program compilation time consists of the latter two digits of the year, month and day, which has a total of 6 characters. If you need to modify the display version number, you need to update the value of the property appVersionLabel in the viewDidLoad method of About page (GosAboutViewController) of SettingsModule.
See Gizwits App Code Auto-Generator to learn about the functionality of the automatically generated App code.
See “Gizwits App Framework” to grasp
See “App Development SDK” to develop your IoT App
More application development guides