Skip to content

Instantly share code, notes, and snippets.

View WirecardMobileServices's full-sized avatar

WirecardMobileServices WirecardMobileServices

View GitHub Profile
@WirecardMobileServices
WirecardMobileServices / podfile
Created April 21, 2017 13:06
AcceptSDK podfile
platform :ios, :deployment_target => "9.0"
use_frameworks!
def shared_dependencies
pod "acceptSDKTwo"
end
target 'AcceptDemo' do
shared_dependencies
end
accept.anyObservableMethod()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(...);
//completable
accept.methodReturnsCompletable().subscribe() //returns disposable, ignores all responses
accept.methodReturnsCompletable().subscribe(CompletableObserver s) //returns disposable, all responses came in given CompletableObserver
accept.methodReturnsCompletable().subscribe(Action onComplete, Consumer<? super Throwable> onError) //returns disposable, successful responses came in onComplete Action and error in onError
accept.methodReturnsCompletable().subscribe(Action onComplete) //returns disposable, successful response came in given Action, error is ignored
//single
accept.methodReturnsSingle().subscribe() //returns disposable, ignores all responses
accept.methodReturnsSingle().subscribe(BiConsumer<? super T, ? super Throwable> onCallback) //returns disposable, all responses came in given
@WirecardMobileServices
WirecardMobileServices / AcceptSDK2-synchronous-example.java
Last active July 10, 2017 12:07
Example of synchronous usage of sdk
//completable
accept.methodReturnsCompletable().blockingAwait() //returns void or rethrows any exception emitted
accept.methodReturnsCompletable().blockingGet() //returns null or the emitted exception if any
//single
accept.methodReturnsSingle().blockingGet() //returns success object or rethrows any exception emitted
@WirecardMobileServices
WirecardMobileServices / AcceptSDK2-parallel-example.java
Last active July 10, 2017 12:07
Example of CompletableParallel and SingleParallel usage
import com.jakewharton.rxrelay2.BehaviorRelay;
import com.jakewharton.rxrelay2.Relay;
import io.reactivex.android.schedulers.AndroidSchedulers;
Relay<Event> eventObservable = BehaviorRelay.create();
accept.methodReturnsSingleParallel()
.subscribeParallel(eventObservable)
.observeOn(AndroidSchedulers.mainThread())