Skip to content

Instantly share code, notes, and snippets.

View tylernappy's full-sized avatar

Tyler N. tylernappy

View GitHub Profile
Uri url = Uri.parse("https://jet.com/");
MerchantAction merchantAction = new MerchantAction(url);
com.usebutton.sdk.Button.getButton().startMerchantAction(merchantAction);
@tylernappy
tylernappy / MainActivity.java
Last active June 15, 2017 20:03
Android Hackathon demo
package com.example.tylernappy.hackathonintro;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.usebutton.sdk.ButtonContext;
import com.usebutton.sdk.ButtonDropin;
import com.usebutton.sdk.context.Location;
public class MainActivity extends AppCompatActivity {
<h1>Angelhack Buttons</h1>
<script>
window.ButtonWebConfig = {
applicationId: 'app-24548843a41b5fad'
};
(function(u,s,e,b,t,n){
u['__bttnio']=b;u[b]=u[b]||function(){(u[b].q=u[b].q||[]).push(arguments)};t=s.createElement(e);n=s.getElementsByTagName(e)[0];t.async=1;t.src='https://web.btncdn.com/v1/button.js';n.parentNode.insertBefore(t,n)
})(window, document, 'script', 'bttnio');
</script>
@tylernappy
tylernappy / AndroidManifest.xml
Created April 9, 2017 23:42
Android workshop
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tylernappy.droidcontest">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
@tylernappy
tylernappy / update_mobile_button.html
Created February 12, 2017 04:27
Dynamically update mobile web Button
<script>
window.ButtonWebConfig = {
applicationId: 'app-24548843a41b5fad'
};
(function(u,s,e,b,t,n){
u['__bttnio']=b;u[b]=u[b]||function(){(u[b].q=u[b].q||[]).push(arguments)};t=s.createElement(e);n=s.getElementsByTagName(e)[0];t.async=1;t.src='https://web.btncdn.com/v1/button.js';n.parentNode.insertBefore(t,n)
})(window, document, 'script', 'bttnio');
</script>
<div id="btn" data-bttnio-id="btn-68594705aded1b5f"

iOS Getting Started

Create a Button on the dashboard

To begin, first you must create a new Button on the dashboard.

During this process, you will do the following:

  • Add the name of your Button
  • Tell Button which platform your Button will be on (iOS, Android, mobile web)
  • Tell Button which app your Button will be in (i.e. the name of your app)
@tylernappy
tylernappy / reactjs_simple_button.html
Created February 8, 2017 21:22
Button in React.js
<!-- reactjs_simple_button.html -->
<h1>Button in React.js</h1>
<div id='usebutton'>
<!-- This is where your Button will render! -->
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
//
// ViewController.swift
// testSomething
//
// Created by Tyler Nappy on 1/30/17.
// Copyright © 2017 Tyler Nappy. All rights reserved.
//
import UIKit
import Button
//
// ViewController.swift
// goPoodler
//
// Created by Tyler Nappy on 1/3/17.
// Copyright © 2017 Tyler Nappy. All rights reserved.
//
import UIKit
import Button