Sample iOS application for Algolia with Firebase Cloud function.
$ bundle install
$ bundle exec pod install
- open
AlgoliaFirebaseSample.xcworkspace - put your
GoogleServices-Info.plist - set your Algolia appID, API key in
AppDelegate.swift
// AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure(options: FirebaseOptions(contentsOfFile: Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")!)!)
Algent.initialize(appID: "APP_ID", apiKey: "API_KEY")
...
...
...
}- set your Firebase App ID in
.firebaserc
{
"projects": {
"default": "APP_ID"
}
}
- npm install
$ cd CloudFunctions/functions
$ npm install
- set Algolia API Key
// algoliaProvider.ts
const algolia = algoliasearch('APP_ID', 'API_KEY')
- compile TypeScript
$ npm run build
- deploy
$ firebase deploy --only functions
This project work only Flame or Blaze plans of Firebase.
Will not work Spark plan.