@@ -0,0 +1,1975 @@
+package net.squanchy.proximity.near;%0A%0Aimport android.os.Parcelable;%0A%0Aimport net.squanchy.proximity.ProximityEvent;%0Aimport net.squanchy.proximity.ProximityProvider;%0Aimport net.squanchy.proximity.ProximityService;%0A%0Aimport io.reactivex.Observable;%0Aimport io.reactivex.ObservableEmitter;%0Aimport io.reactivex.schedulers.Schedulers;%0Aimport it.near.sdk.Geopolis.Beacons.Ranging.ProximityListener;%0Aimport it.near.sdk.Reactions.CustomJSON.CustomJSON;%0Aimport it.near.sdk.Reactions.CustomJSON.CustomJSONReaction;%0Aimport it.near.sdk.Recipes.Models.Recipe;%0A%0Apublic class NearITProximityService implements ProximityService %7B%0A%0A    private static final String PROXIMITY_ACTION = %22action%22;%0A    private static final String SUBJECT_ID = %22subject%22;%0A    private final NearITProximityProvider nearITProximityProvider;%0A%0A    public NearITProximityService(ProximityProvider proximityProvider) %7B%0A        this.nearITProximityProvider = (NearITProximityProvider) proximityProvider;%0A    %7D%0A%0A    @Override%0A    public Observable%3CProximityEvent%3E observeProximityEvents() %7B%0A        return Observable.create((ObservableEmitter%3CProximityEvent%3E e) -%3E %7B%0A            ProximityListener listener = (parcelable, recipe) -%3E %7B%0A                if (parcelable instanceof CustomJSON) %7B%0A                    CustomJSON customJSON = (CustomJSON) parcelable;%0A                    String action = (String) customJSON.getContent().get(PROXIMITY_ACTION);%0A                    String subject = (String) customJSON.getContent().get(SUBJECT_ID);%0A                    if (action != null && subject != null)%0A                        e.onNext(new ProximityEvent(action, subject));%0A                %7D%0A            %7D;%0A            nearITProximityProvider.registerForProximityEvents(listener);%0A%0A            e.setCancellable(() -%3E nearITProximityProvider.deregisterForProximityEvents(listener));%0A        %7D).observeOn(Schedulers.io());%0A    %7D%0A%0A    @Override%0A    public ProximityProvider provider() %7B%0A        return nearITProximityProvider;%0A    %7D%0A%7D%0A

add implementation of near proximity service with event emitted by an observable