npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-lnssh

v0.0.92

Published

Provide lnssh to your React Native application

Downloads

24

Readme

React Native Lnssh (mobile)

A lnssh for react-native, hide when application loaded

Installation

npm install react-native-lnssh --save

Installation (iOS pod install)

  • cd ios

  • 在 Podfile 文件上添加 pod 'WHToast','~>0.1.0' pod 'MBProgressHUD', '~> 1.2.0'

  • pod install

  • In AppDelegate.m

...
#import <Lnssh/LnsshManager.h> //<--- import
...
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"KitchenSink"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [[UIViewController alloc] init];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  [LnsshManager show:rootView]; //<--- add show SplashScreen
  
  return YES;
  • In Info.plis
添加 Privacy - Photo Library Additions Usage Description,
Privacy - Photo Library Additions Usage ,DescriptionNSPhotoLibraryUsageDescription ,
PHAuthorizationStatusLimited 权限

Installation (Android) old version < 0.60

...
include ':react-native-lnssh'
project(':react-native-lnssh').projectDir = new File(settingsDir, '../node_modules/react-native-lnssh/android')
  • In android/app/build.gradle
...
dependencies {
    ...
    implementation project(':react-native-lnssh')
}
  • register module (in MainApplication.java)
......
import com.lnssh.LnsshPackage;  // <--- import

......

@Override
protected List<ReactPackage> getPackages() {
   ......
   new LnsshPackage(),            // <------ add here [the seconde params is translucent]
   ......
}
  • register module (in MainActivity.java)
public class MainActivity extends ReactActivity {
    public static Activity activity;           // <------ add 
    public LnsshManager lnsshmanager; // <------ add here
    ......
    @Override
    protected String getMainComponentName() {
        activity = this;    // <------ add here
        lnsshmanager=new LnsshManager(this);  // <------ add here
       lnsshmanager.splash_show(R.drawable.splash);// <------ 如果设置启动页 add here
    
       ......
    }
}
  • set permission (in AndroidManifest.xml)
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
  • add networkSecurityConfig (in AndroidManifest.xml)
<application
.....
android:networkSecurityConfig="@xml/network_security_config"
...
/>
  • add file_paths(in AndroidManifest.xml)
<provider
		android:name="androidx.core.content.FileProvider"
		android:authorities="${ApplicationId}.fileprovider"
		android:exported="false"
		android:grantUriPermissions="true">
		<meta-data
			android:name="android.support.FILE_PROVIDER_PATHS"
			android:resource="@xml/file_paths" />
	</provider>
  • in file_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
	<root-path name="root" path="/" />
	......
	<files-path name="app_down" path="/lnssh/apk/" />   //<----add here
	<files-path name="share_files" path="/lnssh/record/" />  //<----add here
</paths>
  • in network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
	<base-config cleartextTrafficPermitted="true" />
</network-security-config>
* Copy lines to proguard-rules.pro:
```java
-keep class com.tencent.mm.sdk.** {
  *;
}
*Integrating with login and share

If you are going to integrate login or share functions, you need to create a package named 'wxapi' in your application package and a class named WXEntryActivity in it.

```java 
package com.lnssh.wxapi;

import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WeChatModule;

public class WXEntryActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WeChatModule.handleIntent(getIntent());
    finish();
  }
}
* Then add the following node to AndroidManifest.xml:

```java 
<manifest>
  <application>
    <activity
      android:name=".wxapi.WXEntryActivity"
      android:label="@string/app_name"
      android:exported="true"
    />
  </application>
</manifest>
*Integrating the WeChat Payment

If you are going to integrate payment functionality by using this library, then create a package named also wxapi in your application package and a class named WXPayEntryActivity, this is used to bypass the response to JS level:
```java 
package your.package.wxapi;

import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WeChatModule;

public class WXPayEntryActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WeChatModule.handleIntent(getIntent());
    finish();
  }
}
*Then add the following node to AndroidManifest.xml:
```java 
<manifest>
  <application>
    <activity
      android:name=".wxapi.WXPayEntryActivity"
      android:label="@string/app_name"
      android:exported="true"
    />
  </application>
</manifest>

Usage

Example

'use strict';
var React = require('react');
var ReactNative = require('react-native');
import LnsshManager from "react-native-lnssh";
var {LnsshModule,myImagePicker,WeChat,UpdateManager,permissionSetting} = LnsshManager;

var {
    AppRegistry,
    View,
    Text,
    NativeModules
} = ReactNative;


var KitchenSink = React.createClass({
    componentDidMount: function() {
       LnsshModule.splash_hide();
      WeChat.registerApp('appid');
      WeChat.openWXApp();
    },
    render() {
        return(
            <View>
                <Text>
                    fangyunjiang is a good developer!
                </Text>
            </View>
        );
    }
});

AppRegistry.registerComponent('KitchenSink', () => KitchenSink);