Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rafal Kowalski
    @tharpa
    Welcome to Matchmore Android SDK!
    GiacL
    @GiacL

    Hi, i followed the instruction from github for install the SDK, but it's does'nt work... I can't do the import:
    import io.matchmore.sdk.MatchMore;
    import io.matchmore.sdk.MatchMoreConfig;
    import io.matchmore.sdk.MatchMoreSdk;
    import io.matchmore.sdk.api.models.Publication;
    import io.matchmore.sdk.api.models.Subscription;

    What i don't understand it is i did the same (controlled 2 version) 2 weeks ago and it's work

    maciey
    @maciejburda_twitter

    Hey!

    Thanks for contacting us.

    Are you using java or kotlin?
    GiacL
    @GiacL
    I'm using java with androidstudio
    GiacL
    @GiacL
    wich one do i have to copy?
    GiacL
    @GiacL
    my build gradle is like example.java
    I have just this 2 things in more:
    repositories {
    mavenCentral()
    }
    In dependecies : compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    maciey
    @maciejburda_twitter
    do you have:
     maven { url 'https://jitpack.io' }
    ?
    GiacL
    @GiacL
    yes i have it
    but in a another build gradle
    maciey
    @maciejburda_twitter
    do you have this:
    implementation 'com.github.matchmore.alps-android-sdk:sdk:0.6.0'
    ?
    GiacL
    @GiacL
    yes i have it
    maciey
    @maciejburda_twitter
    java 1.8?
    compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
    GiacL
    @GiacL
    i retried to run build and it's work now
    maciey
    @maciejburda_twitter
    great!
    GiacL
    @GiacL
    ty
    maciey
    @maciejburda_twitter

    no worries!

    Feel free to contact us anytime : - )

    GiacL
    @GiacL
    HI, i have a new problem:
    where do i put java version?
    when i try like the example in sdk.examplejava i have an error when i try to run my app
    maciey
    @maciejburda_twitter
    Screen Shot 2018-04-11 at 16.59.53.png
    bottom
    on module - right click - open module settings
    GiacL
    @GiacL
    thanks, work fine now
    qwunsche
    @qwunsche
    Hello, how can I create a device with a set location using the SDK?
    wenjdu
    @wenjdu
    @qwunsche I guess you want to create a PinDevice ?
    let location = Location(latitude: Double, longitude: Double, altitude: 0.0, horizontalAccuracy: 0.0, verticalAccuracy: 0.0)
            let pin = PinDevice(name: "pin device \(deviceNo)", location: location)
            Matchmore.createPinDevice(pinDevice: pin) { result in
                switch result {
                case let .success(device):
                break
                case let .failure(error):
                break
                }
    }
    qwunsche
    @qwunsche
    Oh I forgot to mention I'm using android studio not swift
    maciey
    @maciejburda_twitter
    @gwunsche than you have to:
    matchmore.createPinDevice(_);
    GiacL
    @GiacL
    we did that, i post the code in the matchmore conversation
    qwunsche
    @qwunsche
    yeah we tried that and it seems to be working but we cannot find a way to assign it an ID other than the mobile device ID we're using to run the app
    maciey
    @maciejburda_twitter
    let me see
    qwunsche
    @qwunsche
    we're on it with @wenjdu in the matchmore channel
    maciey
    @maciejburda_twitter
    This is create device interface function:
    /**
         * Creates new pin device. Device created this way can be accessed via devices store: devices property or through callback's result.
         *
         * @property pinDevice [PinDevice] object that will be created on Matchmore's cloud.
         * @property success Callback that returns successful response's object from the Matchmore's cloud.
         * @property error Callback that returns error response from the Matchmore's cloud.
         */
        fun createPinDevice(pinDevice: PinDevice, success: SuccessCallback<PinDevice>?, error: ErrorCallback?)
    and this is interface for creating publication on any device:
    /**
         * Creates new publication attached to device with given id.
         *
         * @property publication [Publication] object that will be created on Matchmore's cloud.
         * @property deviceWithId id of the device that publication will be attached to.
         * @property success Callback that returns successful response's object from the Matchmore's cloud.
         * @property error Callback that returns error response from the Matchmore's cloud.
         */
        fun createPublication(publication: Publication, deviceWithId: String? = null, success: SuccessCallback<Publication>?, error: ErrorCallback?)

    Note that first you need to create pinDevice and than in it's callback you will receive created pinDevice with proper Id.

    This Id needs to be passed to publication deviceWithId

    maciey
    @maciejburda_twitter
    such code would roughly look like this:
            MatchmoreSDK matchmore = Matchmore.getInstance();
    
            PinDevice pinDeviceThatWillBeCreated = new PinDevice();
            MatchmoreLocation location = new MatchmoreLocation();
            location.setLatitude(10.0);
            location.setLongitude(10.0);
            pinDeviceThatWillBeCreated.setLocation(location);
            matchmore.createPinDevice(pinDeviceThatWillBeCreated, createdPinDevice -> {
                Publication publication = new Publication("Test Topic", 20d, 100000d);
                matchmore.createPublication(publication, createdPinDevice.getId(), createdPublication -> {
                    Log.d("JavaExample", createdPublication.getId());
                    return Unit.INSTANCE;
                }, e -> {
                    Log.d("JavaExample", e.getMessage());
                    return Unit.INSTANCE;
                });
                return Unit.INSTANCE;
            }, e -> {
                Log.d("JavaExample", e.getMessage());
                return Unit.INSTANCE;
            });
    @qwunsche does that help you anyhow?
    qwunsche
    @qwunsche
    alright, I'm gonna try that, thanks a lot
    yeah, I see where my mistake was now
    maciey
    @maciejburda_twitter
    👌🏻