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

Open
#592 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
objective-c, react-native, swift
Domain
api, mobile

Research direction

No file or test is named. Start by reviewing the existing iOS native integration and the JavaScript methods in the React Native package, then determine how Swift and Objective-C callers should access them and share identity between clients. Done means a supported bridge for the requested analytics access in hybrid and bare workflows.

Written by the indexing model from the issue text.

Description

enhancement

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.

Dominant language
TypeScript
Stars
383
Forks
206
Avg merge
14h 45m
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from segmentio/analytics-react-native

All issues in segmentio/analytics-react-native

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.