Skip to content

Using Core C++ library to share code between iOS and Android #634

@mrousavy

Description

@mrousavy

Hi!

I'm developing a wrapper library for MMKV which will be used for the cross-platform framework React Native. Ideally I want to have a single Wrapper <-> MMKV layer, written in C++ which works on Android and iOS. (That's because I'm using JSI and I am somewhat forced to use a shared C++ codebase, so no platform dependent code in Java or ObjC)

I tried to use the MMKVCore pod instead of MMKV:

#include "mmkv-wrapper.h"
#include <MMKVCore/MMKV.h>

But that somehow still imports Obj-C code (NSObject, ..), because I am getting those errors:

Screenshot 2021-02-24 at 09 14 37

Is there a way that I can use MMKV-Core directly to share code between Android and iOS with a single C++ code-base?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions