kikinteractive/mailcheck-objectivec

Name: mailcheck-objectivec

Owner: Kik Interactive

Description: Reduce misspelled email addresses in your iOS app.

Forked from: mailcheck/mailcheck-objectivec

Created: 2016-10-26 07:26:18.0

Updated: 2016-10-26 07:26:21.0

Pushed: 2016-10-26 07:34:46.0

Homepage:

Size: 1571

Language: Objective-C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Mailcheck - Objective-C

The Objective-C library that suggests a right domain when your users misspell it in an email address. See the original at https://github.com/mailcheck/mailcheck.

When your user types in “user@hotnail.con”, Mailcheck will suggest “user@hotmail.com”.

Mailcheck will offer up suggestions for top level domains too, and suggest “.com” when a user types in “user@hotmail.cmo”.

mailcheck-objectivec is part of the Mailcheck family, and we're always on the lookout for more ports and adaptions. Get in touch!

Usage

Copy mailcheck.h and mailcheck.m from the Mailcheck folder to your project.

ort "Mailcheck.h"
ctionary *result = [Mailcheck suggest:@"test@hotnail.com"]

Result will contain nil if the domain appears to be valid. Otherwise the suggestion will be a dictionary like this:

ddress": @"test",
omain":  @"hotmail.com",
ull":    @"test@hotmail.com"}
New in 0.3

Customize the maximum edit distance. For instance with a threshold of 2:

lcheck setThreshold:2]
lcheck check:@"dkasper@gmailll.com"]

will return a suggestion of “dkasper@gmail.com”. With a threshold of 1 no suggestion would be returned for this case. The default value is 3.

New in 0.2

Now includes a check if the email is valid thanks to https://github.com/NZN/NSString-Email

ort "Mailcheck.h"
ctionary *result = [Mailcheck check:@"test@hotnail.com"]

Result will contain keys for “valid” and “suggestion”

alid": @(YES),
uggestion": {@"address": @"test",
             @"domain":  @"hotmail.com",
             @"full":    @"test@hotmail.com"}}

Supply your own domain lists:

ctionary *result = [Mailcheck check:@"test@mydomain.co" domains:@[@"mydomain.co"] topLevelDomains:@[@"co"]];

Or add to the default list:

ctionary *result = [Mailcheck check:@"test@mydomain.co" extraDomains:@[@"mydomain.co"] extraTopLevelDomains:@[@"co"]];

Check the MailcheckDemo or the GHUnit tests in TestMailcheck.m for more usage examples. You can run the tests by loading the demo project and selecting the Tests scheme.

Maintainers
License

Licensed under the MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.