I hereby claim:
- I am ndurell on github.
- I am ndurell (https://keybase.io/ndurell) on keybase.
- I have a public key ASD0kOZ-goL-15d8OGtpW-7l2DFasfT6Zbm_yIgd9T4NrQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
let cachingGitHub = CachingGitHub() | |
struct GitHub { | |
var latestRepos: () -> [Repo] = { return cachingGitHub.latestRepos } | |
var fetchRepos: (@escaping (Result<[Repo], APIError>) -> Void) -> Void = cachingGitHub.fetchRepos | |
} | |
class CachingGitHub { | |
var latestRepos = [Repo]() | |
func fetchRepos(completion: @escaping (Result<[Repo], APIError>) -> Void) { |
create(image: image) { [weak self] key, error in | |
guard let `self` = self else { | |
return | |
} | |
if let error = error { | |
self.completion?(nil, error) | |
self.completion = nil | |
return | |
} |
let path : URL = Bundle.main.path(forResource: "scifi-novels", ofType: "json").flatMap { | |
URL.init(fileURLWithPath: $0) | |
}! | |
let data = try! Data(contentsOf: path) | |
let json = try! JSONSerialization.jsonObject(with: data) as? [String: Any] |
Build google api client:
m_googleApiClient = builder.
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
The location request looks like this:
package com.sessionm.example; | |
import com.sessionm.api.SessionM; | |
public class MyClass { | |
public void myAwesomeMethod() { | |
SessionM.getInstance().logAction("demo_action"); | |
} | |
} |
package test.com.sessionm.app; | |
import test.com.sessionm.R; | |
import com.sessionm.api.BaseActivity; | |
//Just extend the BaseActivity class. | |
//This will automatically make lifecycle calls for you. | |
public class MainActivity extends BaseActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
-dontwarn com.unity3d.player.** | |
-keep class com.sessionm.ui.** {*;} |
<?xml version="1.0" encoding="UTF-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.sessionm.sample" | |
android:versionCode="1" | |
android:versionName="1.0.0" > | |
<uses-sdk | |
android:minSdkVersion="8" | |
android:targetSdkVersion="19" /> | |
<!-- SessionM NOTE: These permissions are required for SessionM --> | |
<uses-permission android:name="android.permission.INTERNET" /> |
#import "SMPortalButton.h" | |
@implementation MyViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
SMPortalButton *portalButton=[SMPortalButton buttonWithType:UIButtonTypeSystem]; | |
[portalButton.button setTitle:@"Portal Button" forState:UIControlStateNormal]; | |
portalButton.frame = CGRectMake(40, 40, 100, 30); |