Share on Remind
Universal link API
base URL: https://www.remind.com/v1/share
query params
url | required | The URL to the shared content | ||
referrer | required | This should be the App ID (on mobile) or the url of the page that contains the share button (on web). | ||
text | optional | An optional set of text to include with the shared URL. |
Example
Following this universal link from web or mobile application
https://www.remind.com/v1/share?url=http://mycompany.com/asdf&referrer=com.mycompany.MyApp&text=This%20is%20awesome%21
Will display in our composer as
This is awesome! http://mycompany.com/asdf
Content from the URL will be automatically expanded when shared on Remind. If included, the text always is displayed before url.
Assets
Assets and guidelines for the Share on Remind button are available in Brand Guidelines.
Sample Code
Web
Adding a Share On Remind button is as simple as adding an anchor tag with the required parameters:
<a class="share-on-remind" href="https://www.remind.com/v1/share?url=<required_url_you_want_to_share>&referer=<required_source_page_url>&text=<optional_body_text>" target="_blank"></a>
Which you can then decorate with Remind styling:
.share-on-remind {
display: block;
width: 185px;
height: 40px;
background: url("https://assets.remind.com/eng/share-on-remind-button-with-text.png") no-repeat top;
background-position: center top;
}
.share-on-remind:active {
background-position: center bottom;
}
Android
Add to the OnClickListener of the Share on Remind button.
String remindShareUrl = String.format("https://www.remind.com/share?referrer=%s&url=%s",
BuildConfig.APPLICATION_ID, url)
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, );
sendIntent.setType("text/plain");
startActivity(sendIntent);
iOS
Objective-C
// Add remindShareButton property.
@interface MyViewController ()
@property (nonatomic, strong) UIButton *remindShareButton;
@end
@implementation MyViewController
// Cleanup target/action in dealloc.
- (void)dealloc
{
[_remindShareButton removeTarget:self action:NULL forControlEvents:UIControlEventTouchUpInside];
[super dealloc];
}
// Add a button to share content to Remind.
- (void)viewDidLoad
{
[super viewDidLoad];
// ...
self.remindShareButton = [UIButton buttonWithType:UIButtonTypeCustom];
// ... customize button font, color, etc.
[self.remindShareButton setImage:[UIImage imageNamed:<#@"remindShareButtonIcon.png"#>] forState:UIControlStateNormal];
[self.remindShareButton addTarget:self action:@selector(remindShareButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.remindShareButton];
// Setup constraints or frame for button.
// ...
}
// Add action that triggers sharing the content via our Universal Link.
- (IBAction)remindShareButtonTapped:(id)sender
{
static NSString *const kRemindShareURL = @"https://www.remind.com/share/v1/link";
NSURLComponents *components = [[NSURLComponents alloc] initWithString:kRemindShareURL];
NSAssert(components != nil, @"Remind share universal link is malformed");
NSURLQueryItem *urlQueryItem = [[NSURLQueryItem alloc] initWithName:@"url" value:<#@"https://my.shared.content.com"#>];
NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier];
NSAssert(bundleID != nil, @"Remind share universal link requires a bundleID");
NSURLQueryItem *bundleIDQueryItem = [[NSURLQueryItem alloc] initWithName:@"referrer" value:bundleID];
[components setQueryItems:@[ urlQueryItem, bundleIDQueryItem ]];
NSURL *remindSharedContentURL = [components URL];
NSAssert(remindSharedContentURL != nil, @"Failed to construct URL from remind share components");
[[UIApplication sharedApplication] openURL:remindSharedContentURL];
}
...
@end
Swift
class MyViewController: UIViewController {
// ...
let remindShareButton = UIButton(type: .custom)
// Remove handled button press in deinit.
deinit {
self.remindShareButton.removeTarget(self, action: nil, for: .touchUpInside)
}
// Add a button to share content to Remind.
override func viewDidLoad() {
super.viewDidLoad()
// ...
// ... customize button font, color, etc.
remindShareButton.setImage(UIImage(named: <#"remindButtonImage.png"#>), for: .normal)
remindShareButton.addTarget(self, action: #selector(remindShareButtonTapped(_:)), for: .touchUpInside)
self.view.addSubview(remindShareButton)
// Setup constraints or frame for button.
// ...
}
// Add action that triggers sharing the content via our Universal Link.
@IBAction
func remindShareButtonTapped(_ sender: UIButton) {
let kRemindShareURL = "https://www.remind.com/share/v1/link"
guard var components = URLComponents(string: kRemindShareURL) else {
assert(false, "Remind share universal link is malformed")
return
}
guard let bundleID = Bundle.main.bundleIdentifier else {
assert(false, "Remind share universal link requires a bundleID")
return
}
let bundleIDQueryItem = URLQueryItem(name: "referrer", value: bundleID)
let urlQueryItem = URLQueryItem(name: "url", value: <#"https://my.shared.content.com"#>)
components.queryItems = [urlQueryItem, bundleIDQueryItem]
guard let remindSharedContentURL = components.url else {
assert(false, "Failed to construct URL from remind share components")
return
}
UIApplication.shared.openURL(remindSharedContentURL)
}
// ...
}