pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
57 stars 2 forks source link

Track event are not logging in IOS (Flutter) #116

Closed ebabhi closed 4 months ago

ebabhi commented 4 months ago

Platform + Version

Flutter 3.16.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7f20e5d18c (3 months ago) • 2023-11-27 09:47:30 -0800
Engine • revision 22b600f240
Tools • Dart 3.2.1 • DevTools 2.28.3

SDK Version pendo_sdk 3.1.0

Framework Flutter

Describe the bug When I call PendoSDK.track(event, parameters), I do not see the track event being logged in the Pendo dashboard under 'Raw Events', but the pre-defined events such as AppSessionStart, AppInForeground, and UpdateUserAttributes do get logged.

To Reproduce Steps to reproduce the behavior: Install the pendo_sdk 3.1.0 and try to log events on IOS platform using flutter

Expected behavior when i log the track event i should be able to see it in pendo dashboard (Raw Events)

Logs There in no error logs flutter: [Pendo] [14:31:19.567] ✅ Channel: <track> was called with arguments: {EventName: HomePage, EventProperties: {screen: DashboardPage, home_item_clicked: My Parcels}}

0xkuj commented 4 months ago

Hi, The track event you are sending looks valid. You cannot, however, look for the event name you specified "HomePage" in your example, inside the raw events. The event inside the raw events will be called "track", and inside it will contain the properties and name you sent about that specific event. I am attaching an example we reproduced that has the same parameters as you mentioned in your log: the track in the raw event list: Screenshot 2024-02-26 at 13 46 44

the track description: image

also, you can look for that event inside pendo dashboard -> Product -> Track Events (they are not immediately updated like raw events, so take that into account)

Let me know if something is not working for you

ebabhi commented 4 months ago

In IOS, Track event get's only logged when i close the app or put the app in background, but in case of android it gets logged instantly

MikePendo commented 4 months ago

In iOS we have a buffer of couple of events. on closing opening the app we send all the buffer. The track event might be in that buffer, I think the size is 3-2 just send couple of track events and you should see them

MikePendo commented 4 months ago

@ebabhi can you see if that make sense on your side

ebabhi commented 4 months ago

@MikePendo i have tried with 10+ events they gets only logged when i close or put app in background

MikePendo commented 4 months ago

mmm strange :( should work. any chance you can add us (ios-sdk@pendo.io) to your test flight so we can look in to it on our side. with explanation on which button you have the track event. or if you have the app on the appstore also fine (BUT in that case the SDK should be integrated). - assuming we can login to you app

ebabhi commented 4 months ago

we haven't release the app yet , but i have notice one thing if i send the event through native app (app that host flutter engine ) the event gets logged instantly, here's the code

       override func application(
           _ application: UIApplication,
           didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
       ) -> Bool {
           // configure firebase
           FirebaseApp.configure()

            AppDelegate.registerPlugins(with: self)
            UNUserNotificationCenter.current().delegate = self

            PendoManager.shared().setup("API_KEY")
            var visitorId = "John Doe"
            var accountId = "ACME"
            var visitorData: [String : any Hashable] = ["age": 27, "country": "USA"]
            var accountData: [String : any Hashable] = ["Tier": 1, "size": "Enterprise"]
            PendoManager.shared().startSession(visitorId, accountId:accountId, visitorData:visitorData, accountData:accountData)
            let eventProperties = ["propety1": "value1", "propety2": "value2"]
            PendoManager.shared().track("customEvent1", eventProperties)  

           // This is required to make any communication available in the action isolate.
           FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
               AppDelegate.registerPlugins(with: registry)
           }

           return super.application(application, didFinishLaunchingWithOptions: launchOptions)
       }

i think there is issue with flutter plugin itself

MikePendo commented 4 months ago

ok, lets do the following in your flutter app can you allow Pendo Logs setDebugMode before you call the setup. Please run the app from within the Xcode and get us the native logs. We should see the track event get logged if everything is correct. (In general the Flutter codless solution is straight forward and passes the track to the native if error occurs it should throw it). Please initiate the Plugin only from Flutter for the sake of those logs

MikePendo commented 4 months ago

@ebabhi Or if possible lets have a call with one of the TS

ebabhi commented 4 months ago

i have opened a ticket in pendo support i hope i get response soon there :)

MikePendo commented 4 months ago

@ebabhi its just we need something to work with. either its logs or app or have a call with TS so we can see the issue. otherwise its hard to say why you dont see the track events displayed

shlomipendo commented 4 months ago

@ebabhi Hey, I'm closing this one as we'll continue the investigation via the support ticket with Pendo TS.