Search Unity

[RELEASED] VK Mobile

Discussion in 'Assets and Asset Store' started by Lucasito, Jun 14, 2019.

  1. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Asset for working with VK SDK for iOS platform (version 1.4.6) and Android (version 2.0.2)
    Unified interface for both platforms.
    Supports authorization, friend list request, user information request, custom universal request.
    If there is no VK application on the device, it opens authorization in the web interface.
    Does not interfere with standard UnityEngine loaders.
    Uses Gradle and CocoaPods.
    Asset has an example scene.


    Link to Documentation
    DEMO Apk for check on device: VKMobile.apk

    Using the plugin

    Access to functions on the Android and iOS is identical.
    VKMob.OnLogin(LoginResult loginResult)
    Set event for login. Send LoginResult.OK or LoginResult.Fail. Example:
    VKMob.OnLogin += result =>
    {
    Debug.Log("Login Result:" + result);
    };

    VKMob.OnTokenExpiredHandler()
    Set event for authorization token is expired. Not worked on iOS. Example:
    VKMob.OnTokenExpiredHandler += () =>
    {
    Debug.Log("Token is expired");
    };

    void VKMob.Login()
    Start login to VK SDK.

    void VKMob.Logout()
    Logout to VK SDK.

    bool VKMob.IsLoggedIn()
    If already authorized, return true.

    void VKMob.Execute(string method, string parameters, Action<ResultData> callback)
    In callback return result universal request. ResultData.Success - request completion status. ResultData.ValueStr – result request or error message. Example:
    VKMob.Execute("friends.get", "{ \"fields\": \"city, online, country, photo_100\", \"order\": \"random\", \"count\" : 3 }", (result)=> { Debug.Log(result.ValueStr) });
    All methods see here.

    void RequestUsers(List<int> uids, Action<bool,VKUser[]> callback)
    In callback return users info. If uids is null, return only current login user info.

    void RequestFriends(int uid, Action<bool,VKUser[]> callback)
    In callback return friends of user uid. If uid is 0, return only friends for current login user.

    string[] VKMob.GetCertificateFingerprint()
    Return fingerprint

    Class VKUser
    public class VKUser
    {
    public int id = 0;
    public string first_name = "";
    public string last_name = "";
    public string photo_100 = "";
    public string photo_200 = "";
    }

    Screenshots:
    Screenshot1.png Screenshot2.png Screenshot3.png
     
    Last edited: Aug 5, 2019
  2. Roman3445

    Roman3445

    Joined:
    Nov 28, 2012
    Posts:
    6
    Hello, I has a problem with iOS

    Undefined symbols for architecture arm64:
    "_IOSAddTokenExpiredHandler"
    and others

    I use a new project and follow all installation instructions. Unity 2019.2.5f1
     

    Attached Files:

    Last edited: Sep 30, 2019
  3. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hello. You use CocoaPods? Open .xcodeproj or .xcworkspace?
     
  4. Roman3445

    Roman3445

    Joined:
    Nov 28, 2012
    Posts:
    6
    Pods installed. .xcworkspace of course
     
  5. Roman3445

    Roman3445

    Joined:
    Nov 28, 2012
    Posts:
    6
    Maybe this warning is important?

    ld: warning: ignoring file /Users/u/p/vk_test/Libraries/VKMobile/Plugins/IOS/libVKMobileLibrary.a, building for iOS-arm64 but attempting to link with file built for iOS-armv7

    ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/u/p/vk_test/Libraries/libiPhone-lib.a(unwind_test_arm64.o)

    Undefined symbols for architecture arm64: ... ...
     
  6. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi. Thanks! Which version of XCode?
    May be, I update plugin, added source and remove static library
     
  7. Roman3445

    Roman3445

    Joined:
    Nov 28, 2012
    Posts:
    6
    Last edited: Oct 4, 2019
  8. Roman3445

    Roman3445

    Joined:
    Nov 28, 2012
    Posts:
    6
    any news?
     
  9. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi!
    I am updating the plugin. I think an update will be ready this week.
     
  10. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    Hi!
    Please, send me your email. I send new unitypackage for testing.
     
  11. Roman_34

    Roman_34

    Joined:
    Nov 1, 2018
    Posts:
    19
    Unfortunately, VK Mobile is no longer available.
    Why? :(((
    The project is not build in XCode with error:

    The linked library 'libVKMobileLibrary.a' is missing one or more architectures required by this target: arm64.

    How I can fix it? Please Help!
     
  12. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    I closed support this plugin.
    Maybe this will help?
    https://developer.apple.com/forums/thread/660782
     
  13. Roman_34

    Roman_34

    Joined:
    Nov 1, 2018
    Posts:
    19
    It's a pity :( Nothing helps with your link.
    And I can't turn off arm64, now - this is Apple's requirement.


    You do not know, maybe there is some plugin for VK authorization. Those that were used by me earlier also no longer work and are not supported :(
     
  14. Lucasito

    Lucasito

    Joined:
    Mar 22, 2013
    Posts:
    80
    I find old changes libs, but it's not verified.
    Please, check this package. Change - remove static library for iOS and added source
     

    Attached Files:

  15. Roman_34

    Roman_34

    Joined:
    Nov 1, 2018
    Posts:
    19
    Big thx! The Code is compiled. But I can't login :( In the callback (OnLoggedIn(LoginResult loginResult)) I get a fail result :(