iOS SDK Setup AppRemark
To integrate AppsOnAir-AppRemark IOS SDK to your iOS native Apps with Swift, SwiftUI or Objective-C, follow the below steps
Step 1. Basic Requirements for service usage
- Make sure to configure the API key properly. For additional information Getting started
Step 2. Info.plist must contain a NSPhotoLibraryUsageDescription name property
The NSPhotoLibraryUsageDescription
name property used in your photo library to allow you to view and select images directly within the application. By granting this permission, you can easily upload photos, create personalized content, and enhance your experience. We respect your privacy and will only use this access to improve your app experience and will never share your photos without your consent .
Step 3. Import the AppsOnAir-AppRemark iOS SDK into your Xcode Project
Using CocoaPods
3.1 Make sure your current Xcode project is closed and in the project root, run sudo gem install cocoapods
.
3.2 Now run pod init
from the terminal in your project directory.
3.3 Open the newly created Podfile
with the code editor you are preferring to open.
3.4 Add the AoA dependency under your project target like below.
target 'your_project_name' do
#only copy below line and paste into your podfile
pod 'AppsOnAir-AppRemark'
end
3.5 Run the following commands on the terminal window of your project's directory.
pod repo update
pod install
3.6 Now open the newly created <project_name>.xcworkspace
file.
Step 4. Add the AoA services initialization code and usage
You can call initialization at your preference however, we recommend you to add initialization code in AppDelegate file's didFinishLaunchingWithOptions
method as follows:
- Swift/SwiftUI:
import AppsOnAir_AppRemark
- Objective-C:
#import "AppsOnAir_AppRemark-Swift.h
- Swift
- Objective-C
- SwiftUI
import AppsOnAir_AppRemark
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// AppRemark Class instance create
let appsOnAirRemarkServices = AppRemarkService.shared
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// help to initialize remark services and customized the screen also using optional
appsOnAirRemarkServices.initialize(shakeGestureEnable: false,options: ["appBarBackgroundColor":"DAF7A6"])
return true
}
// Remaining contents of your AppDelegate Class...
}
#import "AppsOnAir_AppRemark-Swift.h"
@interface AppDelegate ()
@property (nonatomic, strong) AppRemarkService *appRemarkService;
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Help to create App Remark Class instance
self.appRemarkService = [AppRemarkService shared];
// Help to initialize remark services and customized the screen also using optional
[self.appRemarkService initializeWithShakeGestureEnable:true options:@{@"appBarBackgroundColor": @"DAF7A6"}];
return YES;
}
// Remaining contents of your AppDelegate Class...
end
import SwiftUI
import AppsOnAir_AppRemark
@main
struct YOUR_APP_NAME: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// Help to create App Remark Class instance
let appOnAirRemarkService = AppRemarkService.shared
// help to initialize remark services and customized the screen also using optional
appOnAirRemarkService.initialize(shakeGestureEnable: false,options: ["appBarBackgroundColor":"DAF7A6"])
return true
}
// Remaining contents of your AppDelegate Class...
}
Properties Information
initialize(shakeGestureEnable:Bool = true,options: NSDictionary = [:])
- This method configures the remark service.
- The
shakeGestureEnable
parameter controls whether the shake gesture is enabled or disabled for triggering the remark screen. - The
options
parameter accepts a dictionary for customizing the remark screen's UI, such as modifying the app bar's background color or other visual elements.
Available keys of options for Customization
Key | DataType | Value | Description |
---|---|---|---|
pageBackgroundColor | String | "#E8F1FF" | Set page background color |
appBarBackgroundColor | String | "#E8F1FF" | Set appbar background color |
appBarTitleText | String | "Add Remark" | Set appbar title text |
appBarTitleColor | String | "#000000" | Set appbar title color |
remarkTypeLabelText | String | "Remark Type" | Set remark type label text |
descriptionLabelText | String | "Description" | Set description label text |
descriptionHintText | String | "Add description here..." | Set description hint text |
descriptionMaxLength | int | 255 | Set description max length |
buttonText | String | "Submit" | Set button text |
buttonTextColor | String | "#FFFFFF" | Set button text color |
buttonBackgroundColor | String | "#007AFF" | Set button background color |
labelColor | String | "#000000" | Set text field label color |
hintColor | String | "#B1B1B3" | Set text field hint color |
inputTextColor | String | "#000000" | Set text field input text color |
Step 5. Manually open AppRemark Screen
- Swift/SwiftUI
- Objective-C
// Help to Create App Remark Service Class
let appsOnAirRemarkServices = AppRemarkService.shared
//Help to open remark screen manually and add extra data about app
appsOnAirRemarkServices.addRemark(extraPayload: ["XX":"XX"])
// Help to Create App Remark Service Class
@property (nonatomic, strong) AppRemarkService *appRemarkService;
//Help to open remark screen manually and add extra data about app
[self.appRemarkService addRemarkWithExtraPayload:@{@"XX":@"XX"}];
Properties Information
addRemark(extraPayload: NSDictionary = [:])
- This method is used to manually open the remark screen with additional data,allowing users to provide feedback.
- The
extraPayload
parameter is optional and can be used to pass additional metadata, such as the app version, flavors, or any other contextual information. This data is sent along with the feedback to enhance tracking and categorization, making it easier to analyze and act on user inputs effectively .
Step 6. Run your App and Setup your app remark services
Run your app by using Xcode on iOS simulators or any physical device to make sure it builds correctly.