satismeter / satismeter-ios

SatisMeter iOS SDK
https://satismeter.com
MIT License
7 stars 6 forks source link

SatisMeterViewDidShow, SatisMeterViewDidDismiss do not seem to work #3

Closed jsedlacek closed 8 years ago

jsedlacek commented 8 years ago
  1. These delegates are part of our public API.
  2. As reported they are not working correctly

Let's remove them from public API.

esatp commented 8 years ago

1.In view controller that SatisMeterview is shown we need to implement delegate service it looks like this

#import <SatisMeter/SatisMeter.h>
@interface ViewController ()<SatisMeterCoreDelegate>
  1. developers need to implement two delegate methods
-(void)SatisMeterViewDidShow{
    NSLog(@"%s",__func__);
    //do whatever
}
-(void)SatisMeterViewDidDismiss{
    NSLog(@"%s",__func__);
     //do whatever
}
jsedlacek commented 8 years ago

@esatp thanks for clarification. closing.

JaviLorbada commented 3 years ago

@jsedlacek are these working in the latest version 0.2.12? And if so, could it be possible to add an example? Thanks!

jsedlacek commented 3 years ago

@JaviLorbada let me check with the dev team, and get back to you.

Meanwhile, could you please let me know how you'd like to use these delegates?

JaviLorbada commented 3 years ago

Thanks

Meanwhile, could you please let me know how you'd like to use these delegates?

I would like to know when the SatisMeterView is shown by using SatisMeterViewDidShow so that I can bring that view to the superview in the hierarchy.

antongorb commented 3 years ago

Hi @JaviLorbada I have attached an example of how I use delegates

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let traitsDictionary = [
            "name" : "James Bond",
            "plan" : "Gold",
            "createdAt" : "2015-11-01T00:00:00.000Z"
        ]

        SatisMeter.sharedInstance()?.delegate = self
        SatisMeter.sharedInstance().identifyUser(withUserId: "1", writeKey: "key", andTraitsDictionary: traitsDictionary)
    }
}

extension ViewController: SatisMeterCoreDelegate {

    func satisMeterViewDidShow() {
        print("satisMeterViewDidShow")
    }

    func satisMeterViewDidDismiss() {
        print("satisMeterViewDidDismiss")
    }
}