takecian / SwiftRater

A utility that reminds your iPhone app's users to review the app written in pure Swift.
MIT License
356 stars 42 forks source link

Significant event trigger #4

Closed JulesMoorhouse closed 7 years ago

JulesMoorhouse commented 7 years ago

Hi

Does this framework fallback to the new iOS 10 rating api / rules? Awesome I see that it does.

Does it support uialertcontroller?

Also when say 5 significant events occur, can the rating dialog be shown instantly regardless of days or uses ?

Thanks

Jules.

takecian commented 7 years ago

Does this framework fallback to the new iOS 10 rating api / rules? Awesome I see that it does.

SwiftRater supports new rating api here.

Does it support uialertcontroller?

What does it mean? SwiftRater uses uialertcontroller for devices which are iOS10.2 or below.

Also when say 5 significant events occur, can the rating dialog be shown instantly regardless of days or uses ?

Yes. SwiftRater tries to show rating dialog when one of conditions you set meets.

JulesMoorhouse commented 7 years ago

Awesome, that sounds great.

Thanks for your quick reply.

I will have to look into bridging headers for objective c 🤔

takecian commented 7 years ago

As of now SwiftRater is written in Swift and is not able to be used from objective-c as these classes don't have @objc attribute. Wait a 10 minutes to modify to add @objc attribute.

takecian commented 7 years ago

I added @objc to SwiftRater class so you can use it from objc. Please try it out with ver 0.2.0.

JulesMoorhouse commented 7 years ago

Oh ok thanks.

I haven't tried adding a swift cocopod before.

What do I need to do? I've heard I would need to create a bridging header?

Thanks again.

takecian commented 7 years ago

Bridging header is needed if you call Objc code from Swift code. Bridging header is not needed if you call Swift code from Objc code.

You just need to add SwiftRater into Podfile as follows.

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '9.0'
use_frameworks!

target 'YOUR_TARGET' do
  pod 'SwiftRater'
end
JulesMoorhouse commented 7 years ago

Thanks,

How do I call SwiftRater in Objective C, I've added my import and that doesn't cause an error. #import <SwiftRater/SwiftRater.h>

I'm using cocoapods and using use_frameworks!

I've tried the swift code with a semicolon, which I didn't expect to work.

I've also tried [[SwiftRater sharedInstance] incrementSignificantUsageCount];

Not sure what else to try ?

takecian commented 7 years ago

Try this out,

AppDelegate.m

#import "AppDelegate.h"
#import <SwiftRater/SwiftRater-Swift.h>

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    SwiftRater.significantUsesUntilPrompt = 3;
    [SwiftRater appLaunched];
    return YES;
}
...

ViewController.m

#import "ViewController.h"
#import <SwiftRater/SwiftRater-Swift.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [SwiftRater check];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
JulesMoorhouse commented 7 years ago

Sorry for another question.

With debug mode enabled check does fire the rating dialog.

However I've called the significant method more than the significant uses prompt amount and check didn't then fire the rating dialog.

I'm calling check in viewWillAppear.

Here's my setup.

skitch 10
takecian commented 7 years ago

If debug mode enabled, rating dialog popup every time. see logic. If rating dialog shown once, dialog is not shown even if another condition met, as SwiftRater prevent from showing popup too much times. see logic.

JulesMoorhouse commented 7 years ago

Ah ok.

I tried remind me later and then left the screen and returned to it, the rating dialog then appeared. I have daysBeforeReminding set to 1.

JulesMoorhouse commented 7 years ago

It would also be perfect if I could override my application name, as I use a much shorter version for that shown on the home screen.

takecian commented 7 years ago

See README

JulesMoorhouse commented 7 years ago

So daysBeforeReminding is working as expected, surely that should wait regardless of other settings?

takecian commented 7 years ago

Oh, I found issue. I will fix it.

takecian commented 7 years ago

I found issue related reminder, i fixed it. Try it out with 0.2.1.

Thank you!

JulesMoorhouse commented 7 years ago

I'm just about done, however the submit button on the review api dialog isn't working. The submit text is in grey and can not be tapped.

I thought it might be a network issue but that doesn't appear to be the case.

Please advise.

Thanks.

takecian commented 7 years ago

Please attach screenshot. I need more details.

JulesMoorhouse commented 7 years ago

img_4938

JulesMoorhouse commented 7 years ago

Ahhh https://stackoverflow.com/questions/43068925/skstorereviewcontroller-requestreview-doesnt-prompt-for-review

JulesMoorhouse commented 7 years ago

I'm a little concerned. I had my device plugged in and ran from Xcode and the Rating dialog was showing. Now I'm using a testflight version it's not :(, I'm using the latest release of iOS (Not Beta)

JulesMoorhouse commented 7 years ago

OK so while using a testflight build I've tested on....

iOS 10.3.2 - this didn't show a dialog after the significant count was reached or when I use my write a review button. iOS 10.3.1 - the same results. iOS 9 - the old style rating was used correctly in both cases.

http://www.developerinsider.in/skstorereviewcontroller-allow-users-to-provide-ratings-from-within-your-ios-app/

Looking at the bottom paragraph in the post above, this is the expected behaviour.

Nonetheless, it would be nice if there was some sort of failure condition provided by SKStoreReviewController so it was possible to determine that the code was working.

takecian commented 7 years ago

What we can do is to call requestReview() when condition has been met.

This method is void function, so we cannot know whether it succeeded or not. I have just added NSLog when trying to show popup for ver 0.2.2. https://github.com/takecian/SwiftRater/commit/f85f1a1e1d5883758ec52350c1e2b6c449279c05 You could check terminal log.

JulesMoorhouse commented 7 years ago

I've submitted my app review. I'm confident it will work.

Cheers.