Skip to content

Instantly share code, notes, and snippets.

View zaferayan's full-sized avatar
⚛️
Overreacting

Zafer AYAN zaferayan

⚛️
Overreacting
View GitHub Profile
@zaferayan
zaferayan / electrode-native-helloworld.md
Created November 5, 2021 13:31 — forked from hemanth-manoharan/electrode-native-helloworld.md
Tutorial #1: How to create a mini app in Electrode Native and embed it within an outer Android native app

Tutorial #1: How to create a mini app in Electrode Native and embed it within an outer Android native app

This is the first in a series of posts around Electrode Native.

Was not able to directly find a "hello world" type of guide that demonstrates all the capabilities of Electrode Native - like mini-app packaging and OTA (Over-The-Air updates) in the documentation here - https://www.electrode.io/site/docs/getting_started.html

Hence, decided to write one as part of my journey. These posts are more focused on getting the code running than on explanation of the underlying concepts. For details on the concepts, please refer to the Electrode Native documentation directly.

Note: Electrode Native version at the time of writing this tutorial - v0.45.5

@zaferayan
zaferayan / electrode-native-helloworld2.md
Created November 5, 2021 13:31 — forked from hemanth-manoharan/electrode-native-helloworld2.md
Tutorial #2: How to add the second mini app to an outer android app

Tutorial #2: How to add the second mini app to an outer android app

This post is the 2nd one in a series of posts on Electrode Native.

It assumes that one has already completed the steps in Tutorial #1 here - https://gist.github.com/hemanth-manoharan/edb363d575d5c9ab22cbc93b595b8fba

  • First, create a second mini-app and publish it to npm as we did in the previous tutorial.

Assuming that the 2nd app is named app2-miniapp

@zaferayan
zaferayan / electrode-native-helloworld3.md
Created November 5, 2021 13:21 — forked from hemanth-manoharan/electrode-native-helloworld3.md
Tutorial #3: How to perform OTA (Over-The-Air) updates using CodePush
@zaferayan
zaferayan / build.sh
Last active October 11, 2021 17:21
How to create XCFramework
xcodebuild archive \
-workspace FruitBasket2.xcworkspace \
-scheme FruitBasket3 \
-archivePath ~/Desktop/FruitBasket3-iphonesimulator.xcarchive \
-sdk iphonesimulator \
SKIP_INSTALL=NO
xcodebuild archive \
-workspace FruitBasket2.xcworkspace \
-scheme FruitBasket3 \
@zaferayan
zaferayan / pasta.jpeg
Last active December 7, 2023 18:12
Pasta
pasta.jpeg
@zaferayan
zaferayan / ExampleHostObject.cpp
Created September 6, 2021 12:50
ExampleHostObject JSI
#pragma once
#include <jsi/jsi.h>
#include <jni.h>
#include <fbjni/fbjni.h>
using namespace facebook;
class ExampleHostObject : public jsi::HostObject {
public:
#import "FrameHostObject.h"
#import <Foundation/Foundation.h>
#import <jsi/jsi.h>
// Tüm key'leri dönen metot
std::vector<jsi::PropNameID> FrameHostObject::getPropertyNames(jsi::Runtime& rt) {
std::vector<jsi::PropNameID> result;
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("toString")));
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("isValid")));
result.push_back(jsi::PropNameID::forUtf8(rt, std::string("width")));
#pragma once
#import <jsi/jsi.h>
#import <CoreMedia/CMSampleBuffer.h>
#import "Frame.h"
using namespace facebook;
class JSI_EXPORT FrameHostObject: public jsi::HostObject {
public:
@zaferayan
zaferayan / Mmkv.cpp
Created September 6, 2021 12:15
MMKV library install method
void install(jsi::Runtime& jsiRuntime) {
// MMKV.set(key: string, value: string | number | bool)
auto mmkvSet = jsi::Function::createFromHostFunction(jsiRuntime,
jsi::PropNameID::forAsci(jsiRuntime, "mmkvSet"),
2, // key, value
[](
jsi::Runtime& runtime,
const jsi::Value& thisValue,
const jsi::Value* arguments,
size_t count) -> jsi::Value
@zaferayan
zaferayan / build.gradle
Last active June 19, 2021 07:41
Github packages publish
apply plugin: 'maven-publish'
def libVersion = '1.0.0'
def libGroupId = 'com.zaferayan.integration'
def repoUrl = 'https://maven.pkg.github.com/ozcanzaferayan/react-native-as-an-android-lib'
def repoName = "GitHubPackages"
def repoUsername = 'ozcanzaferayan'
def repoPassword = 'GITHUB_ACCESS_TOKEN' // Buraya Github üzerinden aldığınız değeri yapıştırın