Skip to content

Commit

Permalink
Merge pull request #22 from flagship-io/preRelease0623
Browse files Browse the repository at this point in the history
add FSPage for objective c
  • Loading branch information
ABTastyAdel authored Jun 22, 2023
2 parents c0e046c + e78defb commit dbda40d
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions FlagShip/Source/Core/FSVisitor+objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,22 @@

import Foundation

extension FSVisitor{

public extension FSVisitor {
/// For Objective C Project, use the functions below to send Events
/// See https://developers.flagship.io/ios/#hit-tracking
///


/// Get Flag only visible for objective C, use func getFlag<T>(key:String, defaultValue : T?)->FSFlag with generic
@available(swift, obsoleted: 1.0)
@objc public func getFlag(key:String, defaultValue : Any?)->FSFlag{

@objc func getFlag(key: String, defaultValue: Any?) -> FSFlag {
/// Check the key if exist
guard let modification = self.currentFlags[key] else {

return FSFlag(key,nil, defaultValue, self.strategy)
return FSFlag(key, nil, defaultValue, self.strategy)
}

return FSFlag(key,modification, defaultValue, self.strategy)

return FSFlag(key, modification, defaultValue, self.strategy)
}


/**
Send Transaction event

Expand All @@ -37,21 +31,23 @@ extension FSVisitor{
*/
/// sendTransactionEvent only visible for objective C, use sendHit
@available(swift, obsoleted: 1.0)
@objc public func sendTransactionEvent(_ transacEvent: FSTransaction) {

@objc func sendTransactionEvent(_ transacEvent: FSTransaction) {
self.sendHit(transacEvent)
}

/**
Send Page event

@param pageEvent : Page event

*/
/// sendPageEvent only visible for objective C, use sendHit
@available(swift, obsoleted: 1.0)
@objc func sendPageEvent(_ pageEvent: FSPage) {
self.sendHit(pageEvent)
}

/// sendScreenEvent only visible for objective C, use sendHit
@available(swift, obsoleted: 1.0)
@objc public func sendScreenEvent(_ screenEvent: FSScreen) {

@objc func sendScreenEvent(_ screenEvent: FSScreen) {
self.sendHit(screenEvent)
}

Expand All @@ -63,8 +59,7 @@ extension FSVisitor{
*/
/// sendItemEvent only visible for objective C, use sendHit
@available(swift, obsoleted: 1.0)
@objc public func sendItemEvent(_ itemEvent: FSItem) {

@objc func sendItemEvent(_ itemEvent: FSItem) {
self.sendHit(itemEvent)
}

Expand All @@ -76,8 +71,7 @@ extension FSVisitor{
*/
/// sendEventTrack only visible for objective C, use sendHit
@available(swift, obsoleted: 1.0)
@objc public func sendEventTrack(_ eventTrack: FSEvent) {

@objc func sendEventTrack(_ eventTrack: FSEvent) {
self.sendHit(eventTrack)
}
}

0 comments on commit dbda40d

Please sign in to comment.