type 'AEPMobileCore' has no member 'trackAction' error while migrating from ACPCore to AEPCore | Community
Skip to main content
July 31, 2024
Solved

type 'AEPMobileCore' has no member 'trackAction' error while migrating from ACPCore to AEPCore

  • July 31, 2024
  • 1 reply
  • 642 views

Hello,

We have upgraded our Capacitor to version 6 and I was getting error  "Adobe" plugin is not implemented. so I am trying to migrate ACPCore imports to AEPCore in our AdobePlugin.swift file for push notifications. Not sure if it will resolve the error.

I am getting this error while migrating:

AdobePlugin.swift:63:27: error: type 'AEPMobileCore' has no member 'trackAction'
AEPMobileCore.trackAction("tracking", data: piiContextData);

Can someone please help me to figure out what I am missing?
Following is a part of the file which is throwing errors for trackAction. 

 

import Foundation import Capacitor import AEPCore import AEPLifecycle import AEPIdentity import AEPSignal import UserNotifications @objc(AdobePlugin) public class AdobePlugin: CAPPlugin { @objc(trackAction:data:) public static func track(action: String?, data: [String: Any]?) { let deliveryId = data["deliveryId"] as? String ?? "" let broadlogId = data["broadlogId"] as? String ?? "" if (deliveryId == "" || broadlogId == "") { print("trackAction failure") return } else { let piiContextData: [String: String] = [ "deliveryId": deliveryId, "broadlogId": broadlogId, "action": action] //1-open 2-click, 7-impression. AEPMobileCore.trackAction("tracking", data: piiContextData); print(["trackAction result": "success"]) } } } // old code import Foundation import Capacitor import ACPCore import UserNotifications @objc(AdobePlugin) public class AdobePlugin: CAPPlugin { @objc func trackAction(_ call: CAPPluginCall) { let action = call.getString("action") ?? ""; let deliveryId = call.getString("deliveryId") ?? ""; let broadlogId = call.getString("broadlogId") ?? ""; if (deliveryId == "" || broadlogId == "") { call.reject("trackAction failure") } else { let piiContextData: [String: String] = [ "deliveryId": deliveryId, "broadlogId": broadlogId, "action": action] //1-open 2-click, 7-impression. ACPCore.trackAction("tracking", data: piiContextData); call.resolve(["trackAction result": "success"]) } } }

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @arpita_p  I would suggest you to look at this test app code using the same AEPCore import: https://github.com/adobe/aepsdk-core-ios/blob/main/TestApps/TestApp_Swift/AppDelegate.swift

1 reply

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
August 1, 2024

Hello @arpita_p  I would suggest you to look at this test app code using the same AEPCore import: https://github.com/adobe/aepsdk-core-ios/blob/main/TestApps/TestApp_Swift/AppDelegate.swift

Manoj  | https://themartech.pro
arpita_pAuthor
August 1, 2024

Hi @_manoj_kumar_ 
Thank you for the quick response. I was able to pass the ios build and from the file you have shared, things looks good on my swift file but I am still getting error when I allow notifications in my phone. Now it says "Error: "Adobe" plugin is not implemented on ios"