PPFPTITracker.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // PPFPTITracker.h
  3. // PayPalOneTouch
  4. //
  5. // Copyright © 2015 PayPal, Inc. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. @class PPFPTIData;
  9. /**
  10. Delegate for sending the passed in data
  11. */
  12. @protocol PPFPTINetworkAdapterDelegate
  13. /**
  14. Sends the data using whatever transport the delegate implements.
  15. @param fptiData contains the data to send, which URL to send it to, and other request metadata
  16. */
  17. - (void)sendRequestWithData:(nonnull PPFPTIData*)fptiData;
  18. @end
  19. /**
  20. Tracker to send analytics data to.
  21. */
  22. @interface PPFPTITracker : NSObject
  23. /**
  24. Designated initializer.
  25. @param deviceUDID the device's UDID
  26. @param sessionID the session ID to associate all events to
  27. @param networkAdapterDelegate network delegate responsible for sending requests
  28. */
  29. - (nonnull instancetype)initWithDeviceUDID:(nonnull NSString *)deviceUDID
  30. sessionID:(nonnull NSString *)sessionID
  31. networkAdapterDelegate:(nullable id<PPFPTINetworkAdapterDelegate>)networkAdapterDelegate;
  32. /**
  33. The delegate which actually sends the data
  34. */
  35. @property (nonatomic, weak, readwrite, nullable) id<PPFPTINetworkAdapterDelegate> networkAdapterDelegate;
  36. /**
  37. Sends an event with various metrics and data
  38. @param params the analytics data to send
  39. */
  40. - (void)submitEventWithParams:(nonnull NSDictionary *)params;
  41. @end