Skip to content

Commit c05b303

Browse files
authored
Merge pull request #1 from xmartlabs/feature/ios-line-login
Adds iOS wrapper of LINE login
2 parents ba1c6da + ac61790 commit c05b303

File tree

9 files changed

+692
-0
lines changed

9 files changed

+692
-0
lines changed

example/index.android.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
* @flow
5+
*/
6+
7+
import React, { Component } from 'react';
8+
import {
9+
AppRegistry,
10+
StyleSheet,
11+
Text,
12+
View,
13+
TouchableNativeFeedback
14+
} from 'react-native';
15+
16+
import { LoginManager } from 'react-native-line-login'
17+
18+
class example extends Component {
19+
_handleClickLogin () {
20+
LoginManager.login()
21+
.then((user) => {
22+
console.log(user)
23+
})
24+
.catch((err) => {
25+
console.log(err)
26+
})
27+
}
28+
29+
_handleClickLogout () {
30+
LoginManager.logout()
31+
}
32+
33+
render() {
34+
return (
35+
<View style={styles.container}>
36+
<Text style={styles.welcome}>
37+
Welcome to React Native!
38+
</Text>
39+
<Text style={styles.instructions}>
40+
To get started, edit index.android.js
41+
</Text>
42+
<Text style={styles.instructions}>
43+
Double tap R on your keyboard to reload,{'\n'}
44+
Shake or press menu button for dev menu
45+
</Text>
46+
47+
<TouchableNativeFeedback
48+
style={styles.button}
49+
onPress={this._handleClickLogin}>
50+
<View>
51+
<Text>Login</Text>
52+
</View>
53+
</TouchableNativeFeedback>
54+
55+
<TouchableNativeFeedback
56+
style={styles.button}
57+
onPress={this._handleClickLogout}>
58+
<View>
59+
<Text>Logout</Text>
60+
</View>
61+
</TouchableNativeFeedback>
62+
</View>
63+
);
64+
}
65+
}
66+
67+
const styles = StyleSheet.create({
68+
container: {
69+
flex: 1,
70+
justifyContent: 'center',
71+
alignItems: 'center',
72+
backgroundColor: '#F5FCFF',
73+
},
74+
welcome: {
75+
fontSize: 20,
76+
textAlign: 'center',
77+
margin: 10,
78+
},
79+
instructions: {
80+
textAlign: 'center',
81+
color: '#333333',
82+
marginBottom: 5,
83+
},
84+
});
85+
86+
AppRegistry.registerComponent('example', () => example);

example/index.ios.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
* @flow
5+
*/
6+
7+
import React, { Component } from 'react';
8+
import {
9+
AppRegistry,
10+
StyleSheet,
11+
Text,
12+
View,
13+
TouchableHighlight
14+
} from 'react-native';
15+
16+
import LineLogin from 'react-native-line'
17+
18+
class example extends Component {
19+
_handleClickLogin () {
20+
LineLogin.login()
21+
.then((user) => {
22+
console.log(user)
23+
})
24+
.catch((err) => {
25+
console.log(err)
26+
})
27+
}
28+
29+
_handleClickLogout () {
30+
LoginManager.logout()
31+
}
32+
33+
render() {
34+
return (
35+
<View style={styles.container}>
36+
<Text style={styles.welcome}>
37+
Welcome to React Native!
38+
</Text>
39+
<Text style={styles.instructions}>
40+
To get started, edit index.android.js
41+
</Text>
42+
<Text style={styles.instructions}>
43+
Double tap R on your keyboard to reload,{'\n'}
44+
Shake or press menu button for dev menu
45+
</Text>
46+
47+
<TouchableHighlight
48+
style={styles.button}
49+
onPress={this._handleClickLogin}>
50+
<View>
51+
<Text>Login</Text>
52+
</View>
53+
</TouchableHighlight>
54+
55+
<TouchableHighlight
56+
style={styles.button}
57+
onPress={this._handleClickLogout}>
58+
<View>
59+
<Text>Logout</Text>
60+
</View>
61+
</TouchableHighlight>
62+
</View>
63+
);
64+
}
65+
}
66+
67+
const styles = StyleSheet.create({
68+
container: {
69+
flex: 1,
70+
justifyContent: 'center',
71+
alignItems: 'center',
72+
backgroundColor: '#F5FCFF',
73+
},
74+
welcome: {
75+
fontSize: 20,
76+
textAlign: 'center',
77+
margin: 10,
78+
},
79+
instructions: {
80+
textAlign: 'center',
81+
color: '#333333',
82+
marginBottom: 5,
83+
},
84+
});
85+
86+
AppRegistry.registerComponent('example', () => example);
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0820"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "NO"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
18+
BuildableName = "libReact.a"
19+
BlueprintName = "React-tvOS"
20+
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
32+
BuildableName = "example-tvOS.app"
33+
BlueprintName = "example-tvOS"
34+
ReferencedContainer = "container:example.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "NO"
41+
buildForArchiving = "NO"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
46+
BuildableName = "example-tvOSTests.xctest"
47+
BlueprintName = "example-tvOSTests"
48+
ReferencedContainer = "container:example.xcodeproj">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
</BuildActionEntries>
52+
</BuildAction>
53+
<TestAction
54+
buildConfiguration = "Debug"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
shouldUseLaunchSchemeArgsEnv = "YES">
58+
<Testables>
59+
<TestableReference
60+
skipped = "NO">
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
64+
BuildableName = "example-tvOSTests.xctest"
65+
BlueprintName = "example-tvOSTests"
66+
ReferencedContainer = "container:example.xcodeproj">
67+
</BuildableReference>
68+
</TestableReference>
69+
</Testables>
70+
<MacroExpansion>
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
74+
BuildableName = "example-tvOS.app"
75+
BlueprintName = "example-tvOS"
76+
ReferencedContainer = "container:example.xcodeproj">
77+
</BuildableReference>
78+
</MacroExpansion>
79+
<AdditionalOptions>
80+
</AdditionalOptions>
81+
</TestAction>
82+
<LaunchAction
83+
buildConfiguration = "Debug"
84+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
85+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
86+
launchStyle = "0"
87+
useCustomWorkingDirectory = "NO"
88+
ignoresPersistentStateOnLaunch = "NO"
89+
debugDocumentVersioning = "YES"
90+
debugServiceExtension = "internal"
91+
allowLocationSimulation = "YES">
92+
<BuildableProductRunnable
93+
runnableDebuggingMode = "0">
94+
<BuildableReference
95+
BuildableIdentifier = "primary"
96+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
97+
BuildableName = "example-tvOS.app"
98+
BlueprintName = "example-tvOS"
99+
ReferencedContainer = "container:example.xcodeproj">
100+
</BuildableReference>
101+
</BuildableProductRunnable>
102+
<AdditionalOptions>
103+
</AdditionalOptions>
104+
</LaunchAction>
105+
<ProfileAction
106+
buildConfiguration = "Release"
107+
shouldUseLaunchSchemeArgsEnv = "YES"
108+
savedToolIdentifier = ""
109+
useCustomWorkingDirectory = "NO"
110+
debugDocumentVersioning = "YES">
111+
<BuildableProductRunnable
112+
runnableDebuggingMode = "0">
113+
<BuildableReference
114+
BuildableIdentifier = "primary"
115+
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
116+
BuildableName = "example-tvOS.app"
117+
BlueprintName = "example-tvOS"
118+
ReferencedContainer = "container:example.xcodeproj">
119+
</BuildableReference>
120+
</BuildableProductRunnable>
121+
</ProfileAction>
122+
<AnalyzeAction
123+
buildConfiguration = "Debug">
124+
</AnalyzeAction>
125+
<ArchiveAction
126+
buildConfiguration = "Release"
127+
revealArchiveInOrganizer = "YES">
128+
</ArchiveAction>
129+
</Scheme>

0 commit comments

Comments
 (0)