This repository contains the Deployteq Mobile SDK with a demo iOS application which uses our custom library for notifications App is written in Swift, uses Firebase cloud messaging for notifications.
- Clone this repository (default working branch is master)
- Open project directory in terminal and run
pod install
(if you don't have CocoaPods installed the run firstsudo gem install cocoapods
) - Open .xcworkspace file in Xcode and you're ready for using it
- Run the app on simulator or connect an iOS device (supported iOS is 12 and 13). Remember push notifications won't work on the simulator.
To start using the Deployteq library you need to set the keys "authorizationToken" and "integrationId" via Environment. These values will be provided when you contact Deployteq to start integrating with the Deployteq platform.
Cocoapods used the tag system of bitbucket to specifcy which version is being used. When you want to create a new version of the ClangNotifications pod perfrom the following steps
- Tag the version in Bitbucket with the new version number
- Change the $(spec.version) in the ClangNotifications.podspec file to the same version as you just tagged in bitbucket
- Open terminal and navigate to the root of the project and run
pod lib lint
to see if everything is correct - run
pod repo push evillage-podspecs ClangNotifications.podspec
in the same terminal to submit the code to Cocoapods
To generate documentation for this project, follow these simple steps:
- Install Jazzy on your mac by going to terminal and run 'sudo gem install jazzy' this will install the required files need to generate documentation
- Still in terminal navigate to the root of the project and run 'jazzy' the documentation will be generated in the /Documentation folder
- Enjoy the generated documentation!
- Install cocoapods by opening terminal and run
sudo gem install cocoapods
- Open the root folder of your project and run
pod init
this will create aPOD
file which will contain all pod libraries you want to use in your project. - Open the
POD
file in a text editor of your choice (I recommend Visual Studio Code) and uncomment the line where it says:platform :iOS, 'XX.X'
and change theXX.X
to12.0
. - Below the
target 'project_name' do
addsouce 'https://bitbucket.org/wi/evillage-podspecs.git'
- Below the
# Pods for project_name
addpod 'ClangNotifications'
- Head back to the terminal and run
pod install
in the root project of your project (where the POD file is located)
-
To make a notification ticket anywhere in your app, check the demo app and the file AppDelegate+NotificationsExtension.swift
-
In the function "didReceiveRemoteNotification" ask for the string of the
payload let body = userInfo["cd_payload"] as? String ?? ""
-
Then place it in the function buildTheTickets like so:
ClangFunctions().buildTheTickets(parent: (UIApplication.shared.keyWindow?.rootViewController)!, toAdd: body)
-
adding the UIApplication.shared.keyWindow?.rootViewController to parant: