|
Native App |
Web App |
Hybrid App |
설치 경험 수준 |
높음 |
중간 |
높음 |
기존 지식 활용도 |
낮음 |
높음 |
높음 |
유려한 UI |
높음 |
중간 |
중간 |
단말기 기능 이용 |
높음 |
낮음 |
중간 |
|
var React = require('react-native');
var { TabBarIOS, NavigatorIOS } = React;
var App = React.createClass({
render: function() {
return (
<TabBarIOS>
<TabBarIOS.Item title="React Native" selected={true}>
<NavigatorIOS initialRoute={{ title: 'React Native' }} />
</TabBarIOS.Item>
</TabBarIOS>
);
},
});
<Page loaded="load">
<Page.actionBar>
<ActionBar title="Sign in"></ActionBar>
</Page.actionBar>
<StackLayout>
<Image src="res://logo" stretch="none" horizontalAlignment="center" />
<TextField id="email_address" text="{{ email }}" hint="Email Address" keyboardType="email" />
<TextField secure="true" text="{{ password }}" hint="Password" />
<Button text="Sign in" tap="signIn" />
<Button text="Sign up for Groceries" tap="register" cssClass="link" />
</StackLayout>
</Page>
// characterCtrl.js
angular.module('x3m.controllers')
.controller('CharacterCtrl', function ($scope, $state, $http, $ionicLoading, $ionicPopup, $rootScope, ionicMaterialMotion, ionicMaterialInk, $localstorage) {
$scope.getData = function () {
$http.get($rootScope.baseAddress + 'accounts/name/characters')
.success(function (data, status, headers, config) {
$scope.list = data;
})
.error(function (data, status, headers, config) {
$ionicPopup.alert({
title: 'Data Error',
template: 'Status : ' + status + ' - ' + data.code
});
});
};
// 최초 데이터 로드
$scope.getData();
});
// character.html
<ion-view view-title="캐릭터정보">
<ion-content>
<ion-list class="animate-blinds no-padding" ng-repeat="item in list">
<!-- 중략 -->
<p>{{item.session_name}} {{item.civ_name}}</p>
<!-- 중략 -->
</ion-list>
</ion-content>
</ion-view>
https://gcm-http.googleapis.com/gcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark"
}
}
https://gcm-http.googleapis.com/gcm/send
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
{
"to": "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
"data": {
"message": "This is a GCM Topic Message!",
}
}
// gulpfile.js
// 웹서버를 실행한다.
gulp.task('server', function () {
return gulp.src('./www/')
.pipe(webserver());
});
// sass 컴파일 및 minify
gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass({
errLogToConsole: true
}))
.pipe(gulp.dest('./www/css/'))
.pipe(minifyCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
});
// 파일 변경 감지 및 브라우저 재시작
gulp.task('watch', function () {
livereload.listen();
gulp.watch('./www/' + '/**')
.on('change', livereload.changed);
});