👮A commander for your iOS apps – Control your apps even after it gets released.
There are times when it will be require for you to let all of your logged-in users will get logged out, or maybe presented with some view controller displaying new terms and conditions to use your app, or maybe, you want to show a message to your users (not via push notifications), or you simply want to lock your app for a particular time?
There can be just too many cases which will be require you to do but the main question is how it's possible to an already released app? Yes, you can create your own APIs which will do such things for you. But what if you don't want to use your own APIs to take care about it, or you want those actions to get performed so quick that you can't depend on your own APIs.
This is why I have written AppCommander. It will comminicate to your Firebase RealTime Database and will help you to perform an action as quickly as possible.
AppCommander will only follow your instructions which you will give through various commands available and will only call the actions which you have written in advance before it will get released on the AppStore. Isn't it cool?
What AppCommander needs you to do?
- Think about the possible actions you want to do.
- Setup Firebase RealTime Database.
- Setup your app so it can communicate with the Firebase. Read the installations. Points: 1...4
- Setup AppCommander. Point: 5
- Read the Usage to see the usage of the AppCommander. Points: 1...4
- Write the actions which you want to perform by the AppCommander.
- Easy setup and configurations.
- Handling the apps from your Firebase account. Even free account works well.
- Multiple filter options.
[1] Goto https://console.firebase.google.com/
- Choose Add Project
- Add Your Project Details and Click on the "Create Project" button.
- You should see the "Your project is ready". Click on the "Contiue" button.
[2] Welcome to Firebase. Get started here.
- Choose Add Firebase to iOS app. Click on the "iOS" button.
- Add the same BundleId as in your Project. Provide other details and click on the "REGISTER APP" button.
- Download
GoogleService-Info.plist
file and add it to your project. This is very important for the Firebase integration.
[3] You are now in "Overview" screen in your Firebase Dashboard.
- In left panel, click on "Database" option.
- Choose "Realtime Database" and click on the "GET STARTED" button.
- Start in locked mode. This is important, you should know how to manage the authenticaltion with Firebase.
- In Database, "Data" should be selected.
- Click on "add child" [+] button.
- In name, make sure you give "AppCommander" and the value should be a JSON. Sample is added here. Add the keys as per the requirements.
- Hit enter to add it into the Database.
- Goto "RULES" tab next to the "DATA" tab.
- For testing, set
.read
totrue
.
[4] Install Firebase Database to your project using CocoaPods. This is the command: pod Firebase/Database
. Note: You can also install it manually. Or with the sample project you only need to do pod install
since it has already included a podfile.
[5] Add all the files from AppCommander/Source
folder to your Project.
You can read the CHANGELOG file for a particular release.
- Config
AppCommander
inAppDelegate.swift
.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
AppCommander.commander.config()
return true
}
- Listen to commands from the
AppCommander
anywhere in your project. The suitabel place is inAppDelegate
only after configuring theAppCommander
.
AppCommander.commander.execution = { command in
let commandName = command.name ?? ""
if !commandName.isEmpty {
if commandName == "forceExit" {
self.forceExit()
}
}
}
- Write an action to handle the received command.
fileprivate func forceExit() {
exit(1)
}
- Done! ✅
- Add more filter options.
- CocoaPods support.
- Create a video to represent Firebase configuration.
- Create a video to represent AppCommander usage.
You can watch to AppCommander to see continuous updates. Stay tuned.
Have an idea for improvements of this class? Please open an issue.
You can shoot me an email to contact.
See the contributions for details.
The MIT License (MIT)
Read the LICENSE file for details.
AppCommander
and their developer(s) and contributors will not take any liability and responsibility for any of the development you do, actions or code or logic you write, results or issues or erros you may face, lost of data you may make by usingAppCommander
in any of your work which is for your personal or employers or clients. Meaning, if you useAppCommander
classes(files), you're (and your team members are) fully responsible.