Skip to content

Access to Analytics in Swift / Objective C (For hybrid react-native / bare workflow) #592

@mkrn

Description

@mkrn

Summary

Is there a way to expose some modules from the iOS native part of the app from Swift or ObjectiveC?
Pre-2.0 version I was able to achieve that with

import Segment

class Track {
  static func track(event: String, properties: [String : Any]?) {
    Analytics.shared().track(event, properties: properties);
  }
}

The workaround seems to add Analytics for iOS separately. Is there a good way to share identity between 2 clients?

Proposed Solution

Expose some of the javascript methods so they can be called from ObjectiveC or Swift side of the app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions